home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 10 / BBS In A Box Volume X (AMUG) (January 1994).bin / Files / Bus / C / CPUstructure.cpt / lessons1.text < prev    next >
MacBinary  |  1990-07-30  |  13.0 KB  |  [TEXT/PEDT]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: lessons1.text

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Jul 30 00:49:20 1990, modified Mon Jul 30 00:49:20 1990, creator 'PEDT', type ASCII, 12565 bytes "lessons1.text" , at 0x3195 438 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[PEDT]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 6c 65 73 73 6f 6e | 73 31 2e 74 65 78 74 00 |..lesson|s1.text.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 50 45 44 | 54 01 00 00 00 00 00 00 |.TEXTPED|T.......|
|00000050| 00 00 00 00 00 31 15 00 | 00 01 b6 a2 d9 6c d0 a2 |.....1..|.....l..|
|00000060| d9 6c d0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.l......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 7f 30 00 00 |........|.....0..|
|00000080| 0d 4c 65 73 73 6f 6e 20 | 31 0d 49 6e 74 72 6f 64 |.Lesson |1.Introd|
|00000090| 75 63 74 69 6f 6e 0d 0d | 20 20 20 20 20 54 68 69 |uction..| Thi|
|000000a0| 73 20 70 72 6f 67 72 61 | 6d 2c 20 43 50 55 53 74 |s progra|m, CPUSt|
|000000b0| 72 75 63 74 75 72 65 2c | 20 65 78 70 6c 61 69 6e |ructure,| explain|
|000000c0| 73 20 74 68 65 20 69 6e | 6e 65 72 20 77 6f 72 6b |s the in|ner work|
|000000d0| 69 6e 67 73 20 6f 66 20 | 61 20 68 79 70 6f 74 68 |ings of |a hypoth|
|000000e0| 65 74 69 63 61 6c 20 63 | 6f 6d 70 75 74 65 72 27 |etical c|omputer'|
|000000f0| 73 20 43 65 6e 74 72 61 | 6c 20 50 72 6f 63 65 73 |s Centra|l Proces|
|00000100| 73 69 6e 67 20 55 6e 69 | 74 20 28 43 50 55 29 2e |sing Uni|t (CPU).|
|00000110| 20 54 68 6f 75 67 68 20 | 74 68 65 20 43 50 55 20 | Though |the CPU |
|00000120| 73 74 75 64 69 65 64 20 | 69 6e 20 74 68 69 73 20 |studied |in this |
|00000130| 70 72 6f 67 72 61 6d 20 | 69 73 20 68 79 70 6f 74 |program |is hypot|
|00000140| 68 65 74 69 63 61 6c 2c | 20 69 74 73 20 62 61 73 |hetical,| its bas|
|00000150| 69 63 20 70 72 69 6e 63 | 69 70 6c 65 73 20 6f 66 |ic princ|iples of|
|00000160| 20 6f 70 65 72 61 74 69 | 6f 6e 20 61 70 70 6c 79 | operati|on apply|
|00000170| 20 74 6f 20 6d 6f 73 74 | 20 72 65 61 6c 2d 77 6f | to most| real-wo|
|00000180| 72 6c 64 20 43 50 55 73 | 2e 0d 20 20 20 20 20 54 |rld CPUs|.. T|
|00000190| 68 65 20 70 72 6f 67 72 | 61 6d 20 69 73 20 62 72 |he progr|am is br|
|000001a0| 6f 6b 65 6e 20 75 70 20 | 69 6e 74 6f 20 32 30 20 |oken up |into 20 |
|000001b0| 6c 65 73 73 6f 6e 73 20 | 74 68 61 74 20 70 72 6f |lessons |that pro|
|000001c0| 67 72 65 73 73 20 66 72 | 6f 6d 20 74 68 65 20 76 |gress fr|om the v|
|000001d0| 65 72 79 20 62 61 73 69 | 63 20 63 6f 6d 70 6f 6e |ery basi|c compon|
|000001e0| 65 6e 74 73 20 6f 66 20 | 61 20 63 6f 6d 70 75 74 |ents of |a comput|
|000001f0| 65 72 20 28 64 69 67 69 | 74 61 6c 20 6c 6f 67 69 |er (digi|tal logi|
|00000200| 63 20 67 61 74 65 73 29 | 20 75 70 20 74 6f 20 61 |c gates)| up to a|
|00000210| 6e 20 65 78 61 6d 70 6c | 65 20 6f 66 20 74 68 65 |n exampl|e of the|
|00000220| 20 6f 70 65 72 61 74 69 | 6f 6e 20 6f 66 20 61 20 | operati|on of a |
|00000230| 63 6f 6d 70 6c 65 74 65 | 20 43 50 55 2e 0d 20 20 |complete| CPU.. |
|00000240| 20 20 20 42 65 63 61 75 | 73 65 20 65 61 63 68 20 | Becau|se each |
|00000250| 6c 65 73 73 6f 6e 20 69 | 73 20 64 65 70 65 6e 64 |lesson i|s depend|
|00000260| 65 6e 74 20 6f 6e 20 6d | 61 74 65 72 69 61 6c 20 |ent on m|aterial |
|00000270| 70 72 65 73 65 6e 74 65 | 64 20 69 6e 20 70 72 65 |presente|d in pre|
|00000280| 76 69 6f 75 73 20 6c 65 | 73 73 6f 6e 73 2c 20 69 |vious le|ssons, i|
|00000290| 74 20 69 73 20 68 69 67 | 68 6c 79 20 72 65 63 6f |t is hig|hly reco|
|000002a0| 6d 6d 65 6e 64 65 64 20 | 74 68 61 74 20 74 68 65 |mmended |that the|
|000002b0| 20 74 77 65 6e 74 79 20 | 6c 65 73 73 6f 6e 73 20 | twenty |lessons |
|000002c0| 62 65 20 73 74 75 64 69 | 65 64 20 69 6e 20 6f 72 |be studi|ed in or|
|000002d0| 64 65 72 2e 0d 20 20 20 | 20 20 0d 4f 76 65 72 76 |der.. | .Overv|
|000002e0| 69 65 77 0d 20 20 20 20 | 20 0d 20 20 20 20 20 54 |iew. | . T|
|000002f0| 68 65 20 43 50 55 20 69 | 73 20 74 68 65 20 22 62 |he CPU i|s the "b|
|00000300| 72 61 69 6e 73 22 20 6f | 66 20 74 68 65 20 63 6f |rains" o|f the co|
|00000310| 6d 70 75 74 65 72 2e 20 | 49 74 73 20 66 75 6e 63 |mputer. |Its func|
|00000320| 74 69 6f 6e 20 69 73 20 | 74 6f 20 65 78 65 63 75 |tion is |to execu|
|00000330| 74 65 20 70 72 6f 67 72 | 61 6d 73 20 73 74 6f 72 |te progr|ams stor|
|00000340| 65 64 20 69 6e 20 6d 61 | 69 6e 20 6d 65 6d 6f 72 |ed in ma|in memor|
|00000350| 79 20 62 79 20 66 65 74 | 63 68 69 6e 67 20 74 68 |y by fet|ching th|
|00000360| 65 69 72 20 69 6e 73 74 | 72 75 63 74 69 6f 6e 73 |eir inst|ructions|
|00000370| 2c 20 65 78 61 6d 69 6e | 69 6e 67 20 74 68 65 6d |, examin|ing them|
|00000380| 2c 20 61 6e 64 20 74 68 | 65 6e 20 65 78 65 63 75 |, and th|en execu|
|00000390| 74 69 6e 67 20 74 68 65 | 6d 20 6f 6e 65 20 61 66 |ting the|m one af|
|000003a0| 74 65 72 20 61 6e 6f 74 | 68 65 72 2e 20 54 68 65 |ter anot|her. The|
|000003b0| 20 43 50 55 20 63 6f 6e | 73 69 73 74 73 20 6f 66 | CPU con|sists of|
|000003c0| 20 74 68 72 65 65 20 6d | 61 69 6e 20 70 61 72 74 | three m|ain part|
|000003d0| 73 3a 0d 0d 43 6f 6e 74 | 72 6f 6c 20 55 6e 69 74 |s:..Cont|rol Unit|
|000003e0| 20 2d 0d 72 65 73 70 6f | 6e 73 69 62 6c 65 20 66 | -.respo|nsible f|
|000003f0| 6f 72 20 66 65 74 63 68 | 69 6e 67 20 69 6e 73 74 |or fetch|ing inst|
|00000400| 72 75 63 74 69 6f 6e 73 | 20 66 72 6f 6d 20 6d 61 |ructions| from ma|
|00000410| 69 6e 20 6d 65 6d 6f 72 | 79 20 61 6e 64 20 64 65 |in memor|y and de|
|00000420| 74 65 72 6d 69 6e 69 6e | 67 20 74 68 65 69 72 20 |terminin|g their |
|00000430| 74 79 70 65 2e 0d 0d 41 | 72 69 74 68 6d 65 74 69 |type...A|rithmeti|
|00000440| 63 20 4c 6f 67 69 63 20 | 55 6e 69 74 20 2d 0d 70 |c Logic |Unit -.p|
|00000450| 65 72 66 6f 72 6d 73 20 | 6d 61 74 68 65 6d 61 74 |erforms |mathemat|
|00000460| 69 63 61 6c 20 61 6e 64 | 20 6c 6f 67 69 63 61 6c |ical and| logical|
|00000470| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 69 6e 20 6f | operati|ons in o|
|00000480| 72 64 65 72 20 74 6f 20 | 63 61 72 72 79 20 6f 75 |rder to |carry ou|
|00000490| 74 20 74 68 65 20 69 6e | 73 74 72 75 63 74 69 6f |t the in|structio|
|000004a0| 6e 73 2e 0d 0d 53 63 72 | 61 74 63 68 70 61 64 20 |ns...Scr|atchpad |
|000004b0| 52 65 67 69 73 74 65 72 | 73 20 2d 0d 61 20 73 6d |Register|s -.a sm|
|000004c0| 61 6c 6c 20 6e 75 6d 62 | 65 72 20 6f 66 20 72 65 |all numb|er of re|
|000004d0| 67 69 73 74 65 72 73 20 | 74 68 61 74 20 6d 61 6b |gisters |that mak|
|000004e0| 65 20 75 70 20 61 20 73 | 6d 61 6c 6c 2c 20 68 69 |e up a s|mall, hi|
|000004f0| 67 68 2d 73 70 65 65 64 | 20 6d 65 6d 6f 72 79 20 |gh-speed| memory |
|00000500| 75 73 65 64 20 74 6f 20 | 73 74 6f 72 65 20 72 65 |used to |store re|
|00000510| 73 75 6c 74 73 20 61 6e | 64 20 63 6f 6e 74 72 6f |sults an|d contro|
|00000520| 6c 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 2e 20 4f |l inform|ation. O|
|00000530| 6e 65 20 6f 66 20 74 68 | 65 73 65 20 72 65 67 69 |ne of th|ese regi|
|00000540| 73 74 65 72 73 20 69 73 | 20 74 68 65 20 50 72 6f |sters is| the Pro|
|00000550| 67 72 61 6d 20 43 6f 75 | 6e 74 65 72 20 28 50 43 |gram Cou|nter (PC|
|00000560| 29 2c 20 77 68 69 63 68 | 20 6b 65 65 70 73 20 74 |), which| keeps t|
|00000570| 72 61 63 6b 20 6f 66 20 | 74 68 65 20 6e 65 78 74 |rack of |the next|
|00000580| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 74 68 61 | instruc|tion tha|
|00000590| 74 20 69 73 20 74 6f 20 | 62 65 20 65 78 65 63 75 |t is to |be execu|
|000005a0| 74 65 64 20 69 6e 20 6d | 61 69 6e 20 6d 65 6d 6f |ted in m|ain memo|
|000005b0| 72 79 2e 20 41 6e 6f 74 | 68 65 72 20 73 63 72 61 |ry. Anot|her scra|
|000005c0| 74 63 68 70 61 64 20 72 | 65 67 69 73 74 65 72 20 |tchpad r|egister |
|000005d0| 69 73 20 74 68 65 20 49 | 6e 73 74 72 75 63 74 69 |is the I|nstructi|
|000005e0| 6f 6e 20 52 65 67 69 73 | 74 65 72 20 28 49 52 29 |on Regis|ter (IR)|
|000005f0| 2c 20 77 68 69 63 68 20 | 68 6f 6c 64 73 20 74 68 |, which |holds th|
|00000600| 65 20 69 6e 73 74 72 75 | 63 74 69 6f 6e 20 74 68 |e instru|ction th|
|00000610| 61 74 20 69 73 20 63 75 | 72 72 65 6e 74 6c 79 20 |at is cu|rrently |
|00000620| 62 65 69 6e 67 20 65 78 | 65 63 75 74 65 64 2e 0d |being ex|ecuted..|
|00000630| 0d 20 20 20 20 20 54 68 | 65 20 43 50 55 20 69 73 |. Th|e CPU is|
|00000640| 20 64 72 69 76 65 6e 20 | 62 79 20 61 20 73 65 74 | driven |by a set|
|00000650| 20 6f 66 20 69 6e 74 65 | 72 6e 61 6c 2c 20 69 6e | of inte|rnal, in|
|00000660| 61 6c 74 65 72 61 62 6c | 65 20 69 6e 73 74 72 75 |alterabl|e instru|
|00000670| 63 74 69 6f 6e 73 2e 20 | 54 68 65 73 65 20 69 6e |ctions. |These in|
|00000680| 73 74 72 75 63 74 69 6f | 6e 73 2c 20 63 61 6c 6c |structio|ns, call|
|00000690| 65 64 20 6d 69 63 72 6f | 69 6e 73 74 72 75 63 74 |ed micro|instruct|
|000006a0| 69 6f 6e 73 2c 20 61 72 | 65 20 68 65 6c 64 20 69 |ions, ar|e held i|
|000006b0| 6e 20 61 20 73 65 63 74 | 69 6f 6e 20 6f 66 20 52 |n a sect|ion of R|
|000006c0| 65 61 64 20 4f 6e 6c 79 | 20 4d 65 6d 6f 72 79 20 |ead Only| Memory |
|000006d0| 28 52 4f 4d 29 20 77 69 | 74 68 69 6e 20 74 68 65 |(ROM) wi|thin the|
|000006e0| 20 43 50 55 2e 0d 20 20 | 20 20 20 54 68 65 20 6d | CPU.. | The m|
|000006f0| 69 63 72 6f 69 6e 73 74 | 72 75 63 74 69 6f 6e 73 |icroinst|ructions|
|00000700| 20 61 72 65 20 69 6e 20 | 74 68 65 20 66 6f 72 6d | are in |the form|
|00000710| 20 6f 66 20 61 20 73 6d | 61 6c 6c 20 63 6f 6d 70 | of a sm|all comp|
|00000720| 75 74 65 72 20 70 72 6f | 67 72 61 6d 2e 20 54 68 |uter pro|gram. Th|
|00000730| 65 79 20 61 6c 6c 6f 77 | 20 74 68 65 20 43 50 55 |ey allow| the CPU|
|00000740| 20 74 6f 20 63 61 72 72 | 79 20 6f 75 74 20 69 74 | to carr|y out it|
|00000750| 73 20 66 75 6e 63 74 69 | 6f 6e 73 2c 20 73 75 63 |s functi|ons, suc|
|00000760| 68 20 61 73 20 72 65 74 | 72 69 65 76 69 6e 67 20 |h as ret|rieving |
|00000770| 28 66 65 74 63 68 69 6e | 67 29 20 63 6f 64 65 20 |(fetchin|g) code |
|00000780| 66 72 6f 6d 20 6d 61 69 | 6e 20 6d 65 6d 6f 72 79 |from mai|n memory|
|00000790| 20 61 6e 64 20 70 65 72 | 66 6f 72 6d 69 6e 67 20 | and per|forming |
|000007a0| 6d 61 74 68 65 6d 61 74 | 69 63 61 6c 20 61 6e 64 |mathemat|ical and|
|000007b0| 20 6c 6f 67 69 63 61 6c | 20 6f 70 65 72 61 74 69 | logical| operati|
|000007c0| 6f 6e 73 2e 0d 20 20 20 | 20 20 54 68 65 20 6d 69 |ons.. | The mi|
|000007d0| 63 72 6f 69 6e 73 74 72 | 75 63 74 69 6f 6e 73 20 |croinstr|uctions |
|000007e0| 61 72 65 20 63 61 72 72 | 69 65 64 20 6f 75 74 20 |are carr|ied out |
|000007f0| 6f 6e 65 20 61 66 74 65 | 72 20 61 6e 6f 74 68 65 |one afte|r anothe|
|00000800| 72 2c 20 69 6e 20 73 65 | 71 75 65 6e 74 69 61 6c |r, in se|quential|
|00000810| 20 6f 72 64 65 72 2c 20 | 75 6e 6c 65 73 73 20 63 | order, |unless c|
|00000820| 6f 64 65 20 69 6e 20 6d | 61 69 6e 20 6d 65 6d 6f |ode in m|ain memo|
|00000830| 72 79 20 64 69 72 65 63 | 74 73 20 74 68 65 20 43 |ry direc|ts the C|
|00000840| 50 55 20 74 6f 20 75 73 | 65 20 61 20 6d 69 63 72 |PU to us|e a micr|
|00000850| 6f 69 6e 73 74 72 75 63 | 74 69 6f 6e 20 74 68 61 |oinstruc|tion tha|
|00000860| 74 20 69 73 20 6f 75 74 | 20 6f 66 20 73 65 71 75 |t is out| of sequ|
|00000870| 65 6e 63 65 2e 20 0d 20 | 20 20 20 20 54 68 65 20 |ence. . | The |
|00000880| 63 6f 64 65 20 69 6e 20 | 4d 61 69 6e 20 4d 65 6d |code in |Main Mem|
|00000890| 6f 72 79 20 69 73 20 74 | 68 65 20 63 6f 64 65 20 |ory is t|he code |
|000008a0| 6f 66 20 74 68 65 20 61 | 70 70 6c 69 63 61 74 69 |of the a|pplicati|
|000008b0| 6f 6e 20 28 70 72 6f 67 | 72 61 6d 29 20 74 68 61 |on (prog|ram) tha|
|000008c0| 74 20 69 73 20 63 75 72 | 72 65 6e 74 6c 79 20 72 |t is cur|rently r|
|000008d0| 75 6e 6e 69 6e 67 2e 20 | 54 68 65 20 43 50 55 20 |unning. |The CPU |
|000008e0| 63 6f 6e 74 69 6e 75 61 | 6c 6c 79 20 66 65 74 63 |continua|lly fetc|
|000008f0| 68 65 73 20 70 69 65 63 | 65 73 20 6f 66 20 74 68 |hes piec|es of th|
|00000900| 69 73 20 63 6f 64 65 2e | 20 54 68 65 20 63 6f 64 |is code.| The cod|
|00000910| 65 20 69 6e 73 74 72 75 | 63 74 73 20 74 68 65 20 |e instru|cts the |
|00000920| 43 50 55 20 61 73 20 74 | 6f 20 77 68 69 63 68 20 |CPU as t|o which |
|00000930| 6f 66 20 69 74 73 20 6d | 69 63 72 6f 69 6e 73 74 |of its m|icroinst|
|00000940| 72 75 63 74 69 6f 6e 73 | 20 69 74 20 73 68 6f 75 |ructions| it shou|
|00000950| 6c 64 20 75 73 65 2e 0d | 20 20 20 20 20 54 68 65 |ld use..| The|
|00000960| 20 65 78 65 63 75 74 69 | 6f 6e 20 6f 66 20 61 20 | executi|on of a |
|00000970| 70 72 6f 67 72 61 6d 20 | 28 73 75 63 68 20 61 73 |program |(such as|
|00000980| 20 4d 61 63 50 61 69 6e | 74 2c 20 4d 61 63 57 72 | MacPain|t, MacWr|
|00000990| 69 74 65 2c 20 65 74 63 | 29 20 63 61 75 73 65 73 |ite, etc|) causes|
|000009a0| 20 74 68 65 20 43 50 55 | 20 74 6f 20 63 6f 6e 74 | the CPU| to cont|
|000009b0| 69 6e 75 6f 75 73 6c 79 | 20 63 79 63 6c 65 20 74 |inuously| cycle t|
|000009c0| 68 72 6f 75 67 68 20 69 | 74 73 20 69 6e 74 65 72 |hrough i|ts inter|
|000009d0| 6e 61 6c 20 73 65 74 20 | 6f 66 20 6d 69 63 72 6f |nal set |of micro|
|000009e0| 69 6e 73 74 72 75 63 74 | 69 6f 6e 73 2e 20 54 68 |instruct|ions. Th|
|000009f0| 65 20 63 79 63 6c 65 20 | 63 61 6e 20 62 65 20 6f |e cycle |can be o|
|00000a00| 75 74 6c 69 6e 65 64 20 | 61 73 3a 0d 0d 31 2e 20 |utlined |as:..1. |
|00000a10| 46 65 74 63 68 20 74 68 | 65 20 6e 65 78 74 20 70 |Fetch th|e next p|
|00000a20| 69 65 63 65 20 6f 66 20 | 63 6f 64 65 20 28 69 6e |iece of |code (in|
|00000a30| 73 74 72 75 63 74 69 6f | 6e 29 20 66 72 6f 6d 20 |structio|n) from |
|00000a40| 6d 65 6d 6f 72 79 0d 32 | 2e 20 43 68 61 6e 67 65 |memory.2|. Change|
|00000a50| 20 74 68 65 20 50 72 6f | 67 72 61 6d 20 43 6f 75 | the Pro|gram Cou|
|00000a60| 6e 74 65 72 20 73 6f 20 | 74 68 61 74 20 69 74 20 |nter so |that it |
|00000a70| 70 6f 69 6e 74 73 20 74 | 6f 20 74 68 65 20 66 6f |points t|o the fo|
|00000a80| 6c 6c 6f 77 69 6e 67 20 | 69 6e 73 74 72 75 63 74 |llowing |instruct|
|00000a90| 69 6f 6e 0d 33 2e 20 44 | 65 74 65 72 6d 69 6e 65 |ion.3. D|etermine|
|00000aa0| 20 74 68 65 20 74 79 70 | 65 20 6f 66 20 69 6e 73 | the typ|e of ins|
|00000ab0| 74 72 75 63 74 69 6f 6e | 20 6a 75 73 74 20 66 65 |truction| just fe|
|00000ac0| 74 63 68 65 64 0d 34 2e | 20 49 66 20 74 68 65 20 |tched.4.| If the |
|00000ad0| 69 6e 73 74 72 75 63 74 | 69 6f 6e 20 75 73 65 73 |instruct|ion uses|
|00000ae0| 20 64 61 74 61 20 69 6e | 20 6d 65 6d 6f 72 79 2c | data in| memory,|
|00000af0| 20 64 65 74 65 72 6d 69 | 6e 65 20 77 68 65 72 65 | determi|ne where|
|00000b00| 20 74 68 65 20 64 61 74 | 61 20 69 73 0d 35 2e 20 | the dat|a is.5. |
|00000b10| 46 65 74 63 68 20 74 68 | 65 20 64 61 74 61 2c 20 |Fetch th|e data, |
|00000b20| 69 66 20 61 6e 79 2c 20 | 69 6e 74 6f 20 69 6e 74 |if any, |into int|
|00000b30| 65 72 6e 61 6c 20 43 50 | 55 20 73 63 72 61 74 63 |ernal CP|U scratc|
|00000b40| 68 70 61 64 20 72 65 67 | 69 73 74 65 72 73 0d 36 |hpad reg|isters.6|
|00000b50| 2e 20 45 78 65 63 75 74 | 65 20 74 68 65 20 69 6e |. Execut|e the in|
|00000b60| 73 74 72 75 63 74 69 6f | 6e 0d 37 2e 20 53 74 6f |structio|n.7. Sto|
|00000b70| 72 65 20 74 68 65 20 72 | 65 73 75 6c 74 73 20 69 |re the r|esults i|
|00000b80| 6e 20 74 68 65 20 70 72 | 6f 70 65 72 20 70 6c 61 |n the pr|oper pla|
|00000b90| 63 65 2e 0d 38 2e 20 47 | 6f 20 74 6f 20 73 74 65 |ce..8. G|o to ste|
|00000ba0| 70 20 31 20 28 72 65 70 | 65 61 74 20 74 68 65 20 |p 1 (rep|eat the |
|00000bb0| 63 79 63 6c 65 29 0d 0d | 0d 20 20 20 20 20 41 73 |cycle)..|. As|
|00000bc0| 20 79 6f 75 20 73 74 75 | 64 79 20 74 68 65 20 4c | you stu|dy the L|
|00000bd0| 65 73 73 6f 6e 73 2c 20 | 6b 65 65 70 20 69 6e 20 |essons, |keep in |
|00000be0| 6d 69 6e 64 20 74 68 65 | 20 64 69 66 66 65 72 65 |mind the| differe|
|00000bf0| 6e 63 65 20 62 65 74 77 | 65 65 6e 20 69 6e 73 74 |nce betw|een inst|
|00000c00| 72 75 63 74 69 6f 6e 73 | 20 61 6e 64 20 6d 69 63 |ructions| and mic|
|00000c10| 72 6f 69 6e 73 74 72 75 | 63 74 69 6f 6e 73 3a 0d |roinstru|ctions:.|
|00000c20| 0d 49 4e 53 54 52 55 43 | 54 49 4f 4e 53 20 2d 0d |.INSTRUC|TIONS -.|
|00000c30| 61 72 65 20 63 6f 6e 74 | 61 69 6e 65 64 20 69 6e |are cont|ained in|
|00000c40| 20 74 68 65 20 63 6f 64 | 65 20 6f 66 20 74 68 65 | the cod|e of the|
|00000c50| 20 70 72 6f 67 72 61 6d | 20 74 68 61 74 20 74 68 | program| that th|
|00000c60| 65 20 63 6f 6d 70 75 74 | 65 72 20 69 73 20 63 75 |e comput|er is cu|
|00000c70| 72 72 65 6e 74 6c 79 20 | 65 78 65 63 75 74 69 6e |rrently |executin|
|00000c80| 67 20 28 72 75 6e 6e 69 | 6e 67 29 2e 20 54 68 65 |g (runni|ng). The|
|00000c90| 79 20 61 72 65 20 66 65 | 74 63 68 65 64 20 66 72 |y are fe|tched fr|
|00000ca0| 6f 6d 20 6d 61 69 6e 20 | 6d 65 6d 6f 72 79 20 62 |om main |memory b|
|00000cb0| 79 20 74 68 65 20 43 50 | 55 2e 20 54 68 65 79 20 |y the CP|U. They |
|00000cc0| 74 65 6c 6c 20 74 68 65 | 20 43 50 55 20 77 68 69 |tell the| CPU whi|
|00000cd0| 63 68 20 6f 66 20 69 74 | 73 20 6d 69 63 72 6f 69 |ch of it|s microi|
|00000ce0| 6e 73 74 72 75 63 74 69 | 6f 6e 73 20 69 74 20 73 |nstructi|ons it s|
|00000cf0| 68 6f 75 6c 64 20 75 73 | 65 2e 0d 0d 4d 49 43 52 |hould us|e...MICR|
|00000d00| 4f 49 4e 53 54 52 55 43 | 54 49 4f 4e 53 20 2d 0d |OINSTRUC|TIONS -.|
|00000d10| 61 72 65 20 70 65 72 6d | 61 6e 65 6e 74 6c 79 20 |are perm|anently |
|00000d20| 63 6f 6e 74 61 69 6e 65 | 64 20 77 69 74 68 69 6e |containe|d within|
|00000d30| 20 74 68 65 20 43 6f 6e | 74 72 6f 6c 20 55 6e 69 | the Con|trol Uni|
|00000d40| 74 20 6f 66 20 74 68 65 | 20 43 50 55 2e 20 54 68 |t of the| CPU. Th|
|00000d50| 65 79 20 63 6f 6e 74 61 | 69 6e 20 69 6e 66 6f 72 |ey conta|in infor|
|00000d60| 6d 61 74 69 6f 6e 20 74 | 68 61 74 20 6f 74 68 65 |mation t|hat othe|
|00000d70| 72 20 70 61 72 74 73 20 | 6f 66 20 74 68 65 20 43 |r parts |of the C|
|00000d80| 50 55 20 75 73 65 20 69 | 6e 20 6f 72 64 65 72 20 |PU use i|n order |
|00000d90| 74 6f 20 63 61 72 72 79 | 20 6f 75 74 20 74 68 65 |to carry| out the|
|00000da0| 20 61 63 74 69 6f 6e 20 | 73 70 65 63 69 66 69 65 | action |specifie|
|00000db0| 64 20 62 79 20 74 68 65 | 20 49 4e 53 54 52 55 43 |d by the| INSTRUC|
|00000dc0| 54 49 4f 4e 20 66 72 6f | 6d 20 6d 65 6d 6f 72 79 |TION fro|m memory|
|00000dd0| 2e 20 0d 0d 09 09 20 54 | 68 65 20 64 69 66 66 65 |. .... T|he diffe|
|00000de0| 72 65 6e 63 65 73 20 62 | 65 74 77 65 65 6e 20 69 |rences b|etween i|
|00000df0| 6e 73 74 72 75 63 74 69 | 6f 6e 73 20 61 6e 64 20 |nstructi|ons and |
|00000e00| 6d 69 63 72 6f 69 6e 73 | 74 72 75 63 74 69 6f 6e |microins|truction|
|00000e10| 73 20 77 69 6c 6c 20 62 | 65 63 6f 6d 65 20 6d 6f |s will b|ecome mo|
|00000e20| 72 65 20 61 70 70 61 72 | 65 6e 74 20 61 73 20 79 |re appar|ent as y|
|00000e30| 6f 75 20 72 65 61 63 68 | 20 74 68 65 20 66 69 6e |ou reach| the fin|
|00000e40| 61 6c 20 4c 65 73 73 6f | 6e 73 2e 0d 0d 0d 54 48 |al Lesso|ns....TH|
|00000e50| 45 20 47 52 41 50 48 49 | 43 20 57 49 4e 44 4f 57 |E GRAPHI|C WINDOW|
|00000e60| 0d 0d 09 09 20 54 68 65 | 20 73 69 6d 75 6c 61 74 |.... The| simulat|
|00000e70| 69 6f 6e 20 69 6e 20 74 | 68 65 20 47 72 61 70 68 |ion in t|he Graph|
|00000e80| 69 63 20 57 69 6e 64 6f | 77 20 64 65 6d 6f 6e 73 |ic Windo|w demons|
|00000e90| 74 72 61 74 65 73 20 74 | 68 65 20 61 62 6f 76 65 |trates t|he above|
|00000ea0| 20 65 69 67 68 74 20 73 | 74 65 70 73 20 74 68 61 | eight s|teps tha|
|00000eb0| 74 20 74 68 65 20 43 50 | 55 20 63 6f 6e 74 69 6e |t the CP|U contin|
|00000ec0| 75 6f 75 73 6c 79 20 63 | 79 63 6c 65 73 20 74 68 |uously c|ycles th|
|00000ed0| 72 6f 75 67 68 2e 0d 0d | 0d 4c 65 73 73 6f 6e 20 |rough...|.Lesson |
|00000ee0| 32 20 0d 44 69 67 69 74 | 61 6c 20 4c 6f 67 69 63 |2 .Digit|al Logic|
|00000ef0| 0d 0d 20 20 20 20 20 41 | 74 20 74 68 65 20 6c 6f |.. A|t the lo|
|00000f00| 77 65 73 74 20 6c 65 76 | 65 6c 2c 20 63 6f 6d 70 |west lev|el, comp|
|00000f10| 75 74 65 72 20 68 61 72 | 64 77 61 72 65 20 69 73 |uter har|dware is|
|00000f20| 20 6d 61 64 65 20 75 70 | 20 6f 66 20 64 69 67 69 | made up| of digi|
|00000f30| 74 61 6c 20 6c 6f 67 69 | 63 20 67 61 74 65 73 2e |tal logi|c gates.|
|00000f40| 20 54 68 65 79 20 61 72 | 65 20 74 68 65 20 62 61 | They ar|e the ba|
|00000f50| 73 69 63 20 65 6c 65 6d | 65 6e 74 73 20 66 72 6f |sic elem|ents fro|
|00000f60| 6d 20 77 68 69 63 68 20 | 61 6c 6c 20 64 69 67 69 |m which |all digi|
|00000f70| 74 61 6c 20 63 6f 6d 70 | 75 74 65 72 73 20 61 72 |tal comp|uters ar|
|00000f80| 65 20 63 6f 6e 73 74 72 | 75 63 74 65 64 2e 0d 20 |e constr|ucted.. |
|00000f90| 20 20 20 20 41 20 64 69 | 67 69 74 61 6c 20 6c 6f | A di|gital lo|
|00000fa0| 67 69 63 20 67 61 74 65 | 20 75 73 65 73 20 6f 6e |gic gate| uses on|
|00000fb0| 6c 79 20 74 77 6f 20 6c | 6f 67 69 63 61 6c 20 76 |ly two l|ogical v|
|00000fc0| 61 6c 75 65 73 3a 20 22 | 30 22 20 61 6e 64 20 22 |alues: "|0" and "|
|00000fd0| 31 22 2e 20 54 68 65 20 | 67 61 74 65 20 69 6e 74 |1". The |gate int|
|00000fe0| 65 72 70 72 65 74 73 20 | 61 20 76 6f 6c 74 61 67 |erprets |a voltag|
|00000ff0| 65 20 73 69 67 6e 61 6c | 20 74 68 61 74 20 69 73 |e signal| that is|
|00001000| 20 62 65 74 77 65 65 6e | 20 30 20 61 6e 64 20 31 | between| 0 and 1|
|00001010| 20 76 6f 6c 74 20 61 73 | 20 61 20 62 69 6e 61 72 | volt as| a binar|
|00001020| 79 20 30 2e 20 49 74 20 | 69 6e 74 65 72 70 72 65 |y 0. It |interpre|
|00001030| 74 73 20 61 20 76 6f 6c | 74 61 67 65 20 73 69 67 |ts a vol|tage sig|
|00001040| 6e 61 6c 20 74 68 61 74 | 20 69 73 20 62 65 74 77 |nal that| is betw|
|00001050| 65 65 6e 20 32 20 61 6e | 64 20 35 20 76 6f 6c 74 |een 2 an|d 5 volt|
|00001060| 73 20 61 73 20 61 20 62 | 69 6e 61 72 79 20 31 2e |s as a b|inary 1.|
|00001070| 20 56 6f 6c 74 61 67 65 | 73 20 74 68 61 74 20 64 | Voltage|s that d|
|00001080| 6f 20 6e 6f 74 20 66 61 | 6c 6c 20 77 69 74 68 69 |o not fa|ll withi|
|00001090| 6e 20 74 68 69 73 20 72 | 61 6e 67 65 20 61 72 65 |n this r|ange are|
|000010a0| 20 6e 6f 74 20 70 65 72 | 6d 69 74 74 65 64 2e 0d | not per|mitted..|
|000010b0| 20 20 20 20 20 56 6f 6c | 74 61 67 65 73 20 74 68 | Vol|tages th|
|000010c0| 61 74 20 61 72 65 20 69 | 6e 74 65 72 70 72 65 74 |at are i|nterpret|
|000010d0| 65 64 20 61 73 20 62 69 | 6e 61 72 79 20 31 20 61 |ed as bi|nary 1 a|
|000010e0| 72 65 20 72 65 66 65 72 | 72 65 64 20 74 6f 20 61 |re refer|red to a|
|000010f0| 73 20 48 49 47 48 20 6f | 72 20 56 63 63 2e 20 56 |s HIGH o|r Vcc. V|
|00001100| 6f 6c 74 61 67 65 73 20 | 74 68 61 74 20 61 72 65 |oltages |that are|
|00001110| 20 69 6e 74 65 72 70 72 | 65 74 65 64 20 61 73 20 | interpr|eted as |
|00001120| 62 69 6e 61 72 79 20 30 | 20 61 72 65 20 72 65 66 |binary 0| are ref|
|00001130| 65 72 72 65 64 20 74 6f | 20 61 73 20 4c 4f 57 20 |erred to| as LOW |
|00001140| 6f 72 20 67 72 6f 75 6e | 64 2e 0d 20 20 20 20 20 |or groun|d.. |
|00001150| 44 69 67 69 74 61 6c 20 | 67 61 74 65 73 20 61 72 |Digital |gates ar|
|00001160| 65 20 73 6d 61 6c 6c 20 | 65 6c 65 63 74 72 6f 6e |e small |electron|
|00001170| 69 63 20 64 65 76 69 63 | 65 73 20 74 68 61 74 20 |ic devic|es that |
|00001180| 74 61 6b 65 20 69 6e 20 | 74 68 65 73 65 20 76 6f |take in |these vo|
|00001190| 6c 74 61 67 65 20 73 69 | 67 6e 61 6c 73 2c 20 69 |ltage si|gnals, i|
|000011a0| 6e 74 65 72 70 72 65 74 | 20 74 68 65 6d 20 61 73 |nterpret| them as|
|000011b0| 20 22 31 27 73 22 20 6f | 72 20 22 30 27 73 22 2c | "1's" o|r "0's",|
|000011c0| 20 61 6e 64 20 74 68 65 | 6e 20 6f 75 74 70 75 74 | and the|n output|
|000011d0| 20 61 20 76 6f 6c 74 61 | 67 65 20 73 69 67 6e 61 | a volta|ge signa|
|000011e0| 6c 2c 20 77 68 69 63 68 | 20 69 73 20 61 6c 73 6f |l, which| is also|
|000011f0| 20 65 69 74 68 65 72 20 | 61 20 22 31 22 20 6f 72 | either |a "1" or|
|00001200| 20 61 20 22 30 22 2e 0d | 20 20 20 20 20 54 68 65 | a "0"..| The|
|00001210| 20 73 69 78 20 70 72 69 | 6e 63 69 70 6c 65 20 64 | six pri|nciple d|
|00001220| 69 67 69 74 61 6c 20 6c | 6f 67 69 63 20 67 61 74 |igital l|ogic gat|
|00001230| 65 73 20 61 72 65 20 70 | 69 63 74 75 72 65 64 20 |es are p|ictured |
|00001240| 69 6e 20 74 68 65 20 47 | 72 61 70 68 69 63 73 20 |in the G|raphics |
|00001250| 57 69 6e 64 6f 77 2e 20 | 54 68 65 20 6e 61 6d 65 |Window. |The name|
|00001260| 20 61 6e 64 20 66 75 6e | 63 74 69 6f 6e 20 6f 66 | and fun|ction of|
|00001270| 20 65 61 63 68 20 69 73 | 20 6c 69 73 74 65 64 20 | each is| listed |
|00001280| 62 65 6c 6f 77 3a 0d 0d | 4f 52 20 67 61 74 65 20 |below:..|OR gate |
|00001290| 2d 20 0d 69 66 20 61 6e | 79 20 6f 6e 65 20 6f 72 |- .if an|y one or|
|000012a0| 20 6d 6f 72 65 20 6f 66 | 20 74 68 65 20 67 61 74 | more of| the gat|
|000012b0| 65 27 73 20 69 6e 70 75 | 74 73 20 68 61 73 20 61 |e's inpu|ts has a|
|000012c0| 20 76 61 6c 75 65 20 6f | 66 20 22 31 22 2c 20 74 | value o|f "1", t|
|000012d0| 68 65 20 6f 75 74 70 75 | 74 20 6f 66 20 74 68 65 |he outpu|t of the|
|000012e0| 20 67 61 74 65 20 69 73 | 20 61 20 22 31 22 2e 20 | gate is| a "1". |
|000012f0| 49 66 20 6e 6f 6e 65 20 | 6f 66 20 74 68 65 20 69 |If none |of the i|
|00001300| 6e 70 75 74 73 20 69 73 | 20 61 20 22 31 22 2c 20 |nputs is| a "1", |
|00001310| 74 68 65 20 6f 75 74 70 | 75 74 20 69 73 20 61 20 |the outp|ut is a |
|00001320| 22 30 22 2e 20 0d 0d 41 | 4e 44 20 67 61 74 65 20 |"0". ..A|ND gate |
|00001330| 2d 0d 69 66 20 61 6e 64 | 20 6f 6e 6c 79 20 69 66 |-.if and| only if|
|00001340| 20 61 6c 6c 20 6f 66 20 | 74 68 65 20 69 6e 70 75 | all of |the inpu|
|00001350| 74 73 20 61 72 65 20 22 | 31 27 73 22 2c 20 74 68 |ts are "|1's", th|
|00001360| 65 20 6f 75 74 70 75 74 | 20 6f 66 20 74 68 65 20 |e output| of the |
|00001370| 67 61 74 65 20 69 73 20 | 61 20 22 31 22 2e 20 49 |gate is |a "1". I|
|00001380| 66 20 61 6e 79 20 6f 66 | 20 74 68 65 20 69 6e 70 |f any of| the inp|
|00001390| 75 74 73 20 69 73 20 61 | 20 22 30 22 2c 20 74 68 |uts is a| "0", th|
|000013a0| 65 20 6f 75 74 70 75 74 | 20 69 73 20 61 20 22 30 |e output| is a "0|
|000013b0| 22 2e 0d 0d 4e 4f 54 20 | 67 61 74 65 20 28 69 6e |"...NOT |gate (in|
|000013c0| 76 65 72 74 65 72 29 20 | 2d 0d 74 68 65 20 6f 75 |verter) |-.the ou|
|000013d0| 74 70 75 74 20 6f 66 20 | 74 68 65 20 67 61 74 65 |tput of |the gate|
|000013e0| 20 68 61 73 20 61 20 76 | 61 6c 75 65 20 6f 70 70 | has a v|alue opp|
|000013f0| 6f 73 69 74 65 20 6f 66 | 20 74 68 65 20 67 61 74 |osite of| the gat|
|00001400| 65 27 73 20 6f 6e 65 20 | 69 6e 70 75 74 20 76 61 |e's one |input va|
|00001410| 6c 75 65 3a 20 69 66 20 | 74 68 65 20 69 6e 70 75 |lue: if |the inpu|
|00001420| 74 20 69 73 20 61 20 22 | 30 22 2c 20 74 68 65 20 |t is a "|0", the |
|00001430| 6f 75 74 70 75 74 20 69 | 73 20 61 20 22 31 22 2e |output i|s a "1".|
|00001440| 20 49 66 20 74 68 65 20 | 69 6e 70 75 74 20 69 73 | If the |input is|
|00001450| 20 61 20 22 31 22 2c 20 | 74 68 65 20 6f 75 74 70 | a "1", |the outp|
|00001460| 75 74 20 69 73 20 61 20 | 22 30 22 2e 0d 0d 4e 4f |ut is a |"0"...NO|
|00001470| 52 20 67 61 74 65 20 2d | 0d 69 73 20 74 68 65 20 |R gate -|.is the |
|00001480| 6f 70 70 6f 73 69 74 65 | 20 6f 66 20 61 6e 20 4f |opposite| of an O|
|00001490| 52 20 67 61 74 65 2e 20 | 49 66 20 61 6e 79 20 6f |R gate. |If any o|
|000014a0| 6e 65 20 6f 72 20 6d 6f | 72 65 20 6f 66 20 74 68 |ne or mo|re of th|
|000014b0| 65 20 67 61 74 65 73 20 | 69 6e 70 75 74 73 20 68 |e gates |inputs h|
|000014c0| 61 73 20 61 20 76 61 6c | 75 65 20 6f 66 20 22 31 |as a val|ue of "1|
|000014d0| 22 2c 20 74 68 65 20 6f | 75 74 70 75 74 20 6f 66 |", the o|utput of|
|000014e0| 20 74 68 65 20 67 61 74 | 65 20 69 73 20 61 20 22 | the gat|e is a "|
|000014f0| 30 22 2e 20 49 66 20 6e | 6f 6e 65 20 6f 66 20 74 |0". If n|one of t|
|00001500| 68 65 20 69 6e 70 75 74 | 73 20 69 73 20 61 20 22 |he input|s is a "|
|00001510| 31 22 2c 20 74 68 65 20 | 6f 75 74 70 75 74 20 69 |1", the |output i|
|00001520| 73 20 61 20 22 31 22 2e | 0d 0d 58 4f 52 20 67 61 |s a "1".|..XOR ga|
|00001530| 74 65 20 2d 0d 65 78 63 | 6c 75 73 69 76 65 20 4f |te -.exc|lusive O|
|00001540| 52 20 67 61 74 65 2e 20 | 49 66 20 6e 6f 6e 65 20 |R gate. |If none |
|00001550| 6f 72 20 62 6f 74 68 20 | 6f 66 20 74 68 65 20 67 |or both |of the g|
|00001560| 61 74 65 27 73 20 69 6e | 70 75 74 73 20 68 61 73 |ate's in|puts has|
|00001570| 20 61 20 76 61 6c 75 65 | 20 6f 66 20 22 31 22 2c | a value| of "1",|
|00001580| 20 74 68 65 20 6f 75 74 | 70 75 74 20 6f 66 20 74 | the out|put of t|
|00001590| 68 65 20 67 61 74 65 20 | 69 73 20 61 20 22 30 22 |he gate |is a "0"|
|000015a0| 2e 20 49 66 20 6f 6e 65 | 20 6f 66 20 74 68 65 20 |. If one| of the |
|000015b0| 69 6e 70 75 74 73 20 69 | 73 20 61 20 22 31 22 2c |inputs i|s a "1",|
|000015c0| 20 74 68 65 20 6f 75 74 | 70 75 74 20 69 73 20 61 | the out|put is a|
|000015d0| 20 22 31 22 2e 0d 0d 4e | 41 4e 44 20 67 61 74 65 | "1"...N|AND gate|
|000015e0| 20 2d 0d 69 73 20 74 68 | 65 20 6f 70 70 6f 73 69 | -.is th|e opposi|
|000015f0| 74 65 20 6f 66 20 61 6e | 20 41 4e 44 20 67 61 74 |te of an| AND gat|
|00001600| 65 2e 20 49 66 20 61 6e | 64 20 6f 6e 6c 79 20 69 |e. If an|d only i|
|00001610| 66 20 61 6c 6c 20 6f 66 | 20 74 68 65 20 69 6e 70 |f all of| the inp|
|00001620| 75 74 73 20 61 72 65 20 | 22 31 27 73 22 2c 20 74 |uts are |"1's", t|
|00001630| 68 65 20 6f 75 74 70 75 | 74 20 6f 66 20 74 68 65 |he outpu|t of the|
|00001640| 20 67 61 74 65 20 69 73 | 20 61 20 22 30 22 2e 20 | gate is| a "0". |
|00001650| 49 66 20 61 6e 79 20 6f | 66 20 74 68 65 20 69 6e |If any o|f the in|
|00001660| 70 75 74 73 20 69 73 20 | 61 20 22 30 22 2c 20 74 |puts is |a "0", t|
|00001670| 68 65 20 6f 75 74 70 75 | 74 20 69 73 20 61 20 22 |he outpu|t is a "|
|00001680| 31 22 2e 0d 0d 20 20 20 | 20 20 42 79 20 63 6f 6d |1"... | By com|
|00001690| 62 69 6e 69 6e 67 20 74 | 68 65 73 65 20 73 69 78 |bining t|hese six|
|000016a0| 20 74 79 70 65 73 20 6f | 66 20 6c 6f 67 69 63 20 | types o|f logic |
|000016b0| 67 61 74 65 73 20 69 6e | 74 6f 20 65 6c 65 63 74 |gates in|to elect|
|000016c0| 72 69 63 61 6c 20 63 69 | 72 63 75 69 74 73 2c 20 |rical ci|rcuits, |
|000016d0| 64 69 67 69 74 61 6c 20 | 63 69 72 63 75 69 74 73 |digital |circuits|
|000016e0| 20 61 72 65 20 63 6f 6e | 73 74 72 75 63 74 65 64 | are con|structed|
|000016f0| 2e 0d 0d 20 20 20 20 20 | 41 6c 6c 20 6c 6f 67 69 |... |All logi|
|00001700| 63 20 67 61 74 65 73 20 | 68 61 76 65 20 6a 75 73 |c gates |have jus|
|00001710| 74 20 6f 6e 65 20 6f 75 | 74 70 75 74 2e 20 41 20 |t one ou|tput. A |
|00001720| 4e 4f 54 20 67 61 74 65 | 2c 20 61 6c 73 6f 20 63 |NOT gate|, also c|
|00001730| 61 6c 6c 65 64 20 61 6e | 20 69 6e 76 65 72 74 65 |alled an| inverte|
|00001740| 72 2c 20 6d 61 79 20 68 | 61 76 65 20 6f 6e 6c 79 |r, may h|ave only|
|00001750| 20 6f 6e 65 20 69 6e 70 | 75 74 2e 20 54 68 65 20 | one inp|ut. The |
|00001760| 6f 74 68 65 72 20 66 69 | 76 65 20 67 61 74 65 20 |other fi|ve gate |
|00001770| 74 79 70 65 73 2c 20 70 | 69 63 74 75 72 65 64 20 |types, p|ictured |
|00001780| 69 6e 20 74 68 65 20 47 | 72 61 70 68 69 63 73 20 |in the G|raphics |
|00001790| 57 69 6e 64 6f 77 20 77 | 69 74 68 20 74 77 6f 20 |Window w|ith two |
|000017a0| 69 6e 70 75 74 73 2c 20 | 6d 61 79 20 68 61 76 65 |inputs, |may have|
|000017b0| 20 74 77 6f 20 6f 72 20 | 6d 6f 72 65 20 69 6e 70 | two or |more inp|
|000017c0| 75 74 73 2e 20 54 68 65 | 20 73 61 6d 65 20 70 72 |uts. The| same pr|
|000017d0| 69 6e 63 69 70 6c 65 73 | 20 61 70 70 6c 79 20 74 |inciples| apply t|
|000017e0| 6f 20 61 20 6c 6f 67 69 | 63 20 67 61 74 65 20 72 |o a logi|c gate r|
|000017f0| 65 67 61 72 64 6c 65 73 | 73 20 6f 66 20 74 68 65 |egardles|s of the|
|00001800| 20 6e 75 6d 62 65 72 20 | 6f 66 20 69 6e 70 75 74 | number |of input|
|00001810| 73 20 69 74 20 68 61 73 | 2e 0d 0d 0d 54 48 45 20 |s it has|....THE |
|00001820| 47 52 41 50 48 49 43 20 | 57 49 4e 44 4f 57 0d 0d |GRAPHIC |WINDOW..|
|00001830| 09 09 20 54 68 65 20 47 | 72 61 70 68 69 63 20 57 |.. The G|raphic W|
|00001840| 69 6e 64 6f 77 20 73 68 | 6f 77 73 20 65 61 63 68 |indow sh|ows each|
|00001850| 20 6f 66 20 74 68 65 20 | 66 69 76 65 20 62 61 73 | of the |five bas|
|00001860| 69 63 20 67 61 74 65 73 | 20 6d 65 6e 74 69 6f 6e |ic gates| mention|
|00001870| 65 64 20 61 62 6f 76 65 | 2e 20 54 68 65 20 45 64 |ed above|. The Ed|
|00001880| 69 74 20 42 6f 78 65 73 | 20 73 65 72 76 65 20 61 |it Boxes| serve a|
|00001890| 73 20 74 68 65 20 69 6e | 70 75 74 73 20 74 6f 20 |s the in|puts to |
|000018a0| 65 61 63 68 20 67 61 74 | 65 2e 20 45 6e 74 65 72 |each gat|e. Enter|
|000018b0| 20 61 20 22 31 22 20 6f | 72 20 61 20 22 30 22 20 | a "1" o|r a "0" |
|000018c0| 69 6e 20 65 61 63 68 20 | 6f 66 20 74 68 65 20 45 |in each |of the E|
|000018d0| 64 69 74 20 42 6f 78 65 | 73 2c 20 74 68 65 6e 20 |dit Boxe|s, then |
|000018e0| 72 75 6e 20 74 68 65 20 | 73 69 6d 75 6c 61 74 69 |run the |simulati|
|000018f0| 6f 6e 20 74 6f 20 73 65 | 65 20 74 68 65 20 67 61 |on to se|e the ga|
|00001900| 74 65 20 6f 75 74 70 75 | 74 73 2e 0d 0d 0d 4c 65 |te outpu|ts....Le|
|00001910| 73 73 6f 6e 20 33 20 0d | 4d 75 6c 74 69 70 6c 65 |sson 3 .|Multiple|
|00001920| 78 65 72 0d 0d 09 09 20 | 41 20 6d 75 6c 74 69 70 |xer.... |A multip|
|00001930| 6c 65 78 65 72 20 28 61 | 6c 73 6f 20 63 61 6c 6c |lexer (a|lso call|
|00001940| 65 64 20 61 20 4d 55 58 | 29 20 69 73 20 61 20 63 |ed a MUX|) is a c|
|00001950| 69 72 63 75 69 74 20 77 | 69 74 68 20 74 77 6f 20 |ircuit w|ith two |
|00001960| 6f 72 20 6d 6f 72 65 20 | 64 61 74 61 20 69 6e 70 |or more |data inp|
|00001970| 75 74 73 2c 20 6f 6e 65 | 20 64 61 74 61 20 6f 75 |uts, one| data ou|
|00001980| 74 70 75 74 2c 20 61 6e | 64 20 63 6f 6e 74 72 6f |tput, an|d contro|
|00001990| 6c 20 28 73 65 6c 65 63 | 74 29 20 6c 69 6e 65 73 |l (selec|t) lines|
|000019a0| 2e 20 54 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |. The nu|mber of |
|000019b0| 64 61 74 61 20 69 6e 70 | 75 74 73 20 74 68 61 74 |data inp|uts that|
|000019c0| 20 74 68 65 20 63 69 72 | 63 75 69 74 20 6d 61 79 | the cir|cuit may|
|000019d0| 20 68 61 76 65 20 69 73 | 20 64 65 70 65 6e 64 65 | have is| depende|
|000019e0| 6e 74 20 6f 6e 20 74 68 | 65 20 6e 75 6d 62 65 72 |nt on th|e number|
|000019f0| 20 6f 66 20 63 6f 6e 74 | 72 6f 6c 20 6c 69 6e 65 | of cont|rol line|
|00001a00| 73 2e 20 49 66 20 61 20 | 6d 75 6c 74 69 70 6c 65 |s. If a |multiple|
|00001a10| 78 65 72 20 68 61 73 20 | 6e 20 63 6f 6e 74 72 6f |xer has |n contro|
|00001a20| 6c 20 6c 69 6e 65 73 2c | 20 69 74 20 63 61 6e 20 |l lines,| it can |
|00001a30| 74 68 65 6e 20 68 61 6e | 64 6c 65 20 32 5e 6e 20 |then han|dle 2^n |
|00001a40| 64 61 74 61 20 69 6e 70 | 75 74 73 2e 20 41 6c 6c |data inp|uts. All|
|00001a50| 20 6d 75 6c 74 69 70 6c | 65 78 65 72 73 20 68 61 | multipl|exers ha|
|00001a60| 76 65 20 6a 75 73 74 20 | 6f 6e 65 20 6f 75 74 70 |ve just |one outp|
|00001a70| 75 74 2e 0d 09 09 20 54 | 68 65 20 6e 75 6d 62 65 |ut.... T|he numbe|
|00001a80| 72 20 6f 66 20 64 61 74 | 61 20 69 6e 70 75 74 73 |r of dat|a inputs|
|00001a90| 20 67 69 76 65 73 20 74 | 68 65 20 6d 75 6c 74 69 | gives t|he multi|
|00001aa0| 70 6c 65 78 65 72 20 69 | 74 73 20 73 70 65 63 69 |plexer i|ts speci|
|00001ab0| 66 69 63 20 6e 61 6d 65 | 3a 20 61 20 66 6f 75 72 |fic name|: a four|
|00001ac0| 20 69 6e 70 75 74 2c 20 | 6f 6e 65 20 6f 75 74 70 | input, |one outp|
|00001ad0| 75 74 20 6d 75 6c 74 69 | 70 6c 65 78 65 72 20 69 |ut multi|plexer i|
|00001ae0| 73 20 63 61 6c 6c 65 64 | 20 61 20 34 2d 74 6f 2d |s called| a 4-to-|
|00001af0| 31 20 4d 55 58 2c 20 61 | 6e 20 65 69 67 68 74 20 |1 MUX, a|n eight |
|00001b00| 69 6e 70 75 74 20 6d 75 | 6c 74 69 70 6c 65 78 65 |input mu|ltiplexe|
|00001b10| 72 20 69 73 20 63 61 6c | 6c 65 64 20 61 6e 20 38 |r is cal|led an 8|
|00001b20| 2d 74 6f 2d 31 20 4d 55 | 58 2c 20 65 74 63 2e 20 |-to-1 MU|X, etc. |
|00001b30| 0d 09 09 20 54 68 65 20 | 76 61 6c 75 65 73 20 6f |... The |values o|
|00001b40| 6e 20 74 68 65 20 63 6f | 6e 74 72 6f 6c 20 6c 69 |n the co|ntrol li|
|00001b50| 6e 65 73 20 74 65 6c 6c | 20 74 68 65 20 6d 75 6c |nes tell| the mul|
|00001b60| 74 69 70 6c 65 78 65 72 | 20 77 68 69 63 68 20 6f |tiplexer| which o|
|00001b70| 6e 65 20 6f 66 20 74 68 | 65 20 64 61 74 61 20 69 |ne of th|e data i|
|00001b80| 6e 70 75 74 73 20 73 68 | 6f 75 6c 64 20 62 65 20 |nputs sh|ould be |
|00001b90| 70 61 73 73 65 64 20 74 | 68 72 6f 75 67 68 20 74 |passed t|hrough t|
|00001ba0| 68 65 20 63 69 72 63 75 | 69 74 20 74 6f 20 74 68 |he circu|it to th|
|00001bb0| 65 20 6f 75 74 70 75 74 | 2e 20 54 68 65 20 70 75 |e output|. The pu|
|00001bc0| 72 70 6f 73 65 20 6f 66 | 20 74 68 65 20 4d 55 58 |rpose of| the MUX|
|00001bd0| 20 69 73 20 74 6f 20 73 | 65 6c 65 63 74 20 69 6e | is to s|elect in|
|00001be0| 66 6f 72 6d 61 74 69 6f | 6e 20 66 72 6f 6d 20 6f |formatio|n from o|
|00001bf0| 6e 65 20 6f 66 20 73 65 | 76 65 72 61 6c 20 69 6e |ne of se|veral in|
|00001c00| 70 75 74 20 74 65 72 6d | 69 6e 61 6c 73 20 61 6e |put term|inals an|
|00001c10| 64 20 72 6f 75 74 65 20 | 74 68 61 74 20 69 6e 70 |d route |that inp|
|00001c20| 75 74 20 74 6f 20 61 20 | 73 69 6e 67 6c 65 20 6f |ut to a |single o|
|00001c30| 75 74 70 75 74 20 6c 65 | 61 64 2e 20 0d 09 09 20 |utput le|ad. ... |
|00001c40| 41 6e 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 6f |An appli|cation o|
|00001c50| 66 20 61 20 6d 75 6c 74 | 69 70 6c 65 78 65 72 20 |f a mult|iplexer |
|00001c60| 69 73 20 61 20 70 61 72 | 61 6c 6c 65 6c 2d 74 6f |is a par|allel-to|
|00001c70| 2d 73 65 72 69 61 6c 20 | 63 6f 6e 76 65 72 74 65 |-serial |converte|
|00001c80| 72 2e 20 42 79 20 70 75 | 74 74 69 6e 67 20 34 20 |r. By pu|tting 4 |
|00001c90| 62 69 74 73 20 6f 66 20 | 64 61 74 61 20 6f 6e 20 |bits of |data on |
|00001ca0| 74 68 65 20 69 6e 70 75 | 74 20 6c 69 6e 65 73 20 |the inpu|t lines |
|00001cb0| 6f 66 20 61 20 34 2d 74 | 6f 2d 31 20 4d 55 58 2c |of a 4-t|o-1 MUX,|
|00001cc0| 20 61 6e 64 20 74 68 65 | 6e 20 73 74 65 70 70 69 | and the|n steppi|
|00001cd0| 6e 67 20 74 68 65 20 63 | 6f 6e 74 72 6f 6c 20 6c |ng the c|ontrol l|
|00001ce0| 69 6e 65 73 20 73 65 71 | 75 65 6e 74 69 61 6c 6c |ines seq|uentiall|
|00001cf0| 79 20 66 72 6f 6d 20 30 | 30 20 74 6f 20 31 31 20 |y from 0|0 to 11 |
|00001d00| 28 62 69 6e 61 72 79 3a | 20 30 30 20 30 31 20 31 |(binary:| 00 01 1|
|00001d10| 30 20 31 31 29 2c 20 74 | 68 65 20 34 20 62 69 74 |0 11), t|he 4 bit|
|00001d20| 73 20 61 72 65 20 70 75 | 74 20 6f 6e 74 6f 20 74 |s are pu|t onto t|
|00001d30| 68 65 20 6f 75 74 70 75 | 74 20 6c 69 6e 65 20 69 |he outpu|t line i|
|00001d40| 6e 20 73 65 72 69 65 73 | 2e 20 0d 0d 0d 54 48 45 |n series|. ...THE|
|00001d50| 20 47 52 41 50 48 49 43 | 20 57 49 4e 44 4f 57 0d | GRAPHIC| WINDOW.|
|00001d60| 0d 09 09 20 54 68 65 20 | 47 72 61 70 68 69 63 20 |... The |Graphic |
|00001d70| 57 69 6e 64 6f 77 20 73 | 68 6f 77 73 20 61 20 66 |Window s|hows a f|
|00001d80| 6f 75 72 2d 69 6e 70 75 | 74 20 6d 75 6c 74 69 70 |our-inpu|t multip|
|00001d90| 6c 65 78 65 72 20 63 69 | 72 63 75 69 74 20 28 34 |lexer ci|rcuit (4|
|00001da0| 2d 74 6f 2d 31 20 4d 55 | 58 29 2e 20 41 73 20 64 |-to-1 MU|X). As d|
|00001db0| 65 66 69 6e 65 64 20 61 | 62 6f 76 65 2c 20 61 20 |efined a|bove, a |
|00001dc0| 6d 75 6c 74 69 70 6c 65 | 78 65 72 20 68 61 73 20 |multiple|xer has |
|00001dd0| 32 5e 6e 20 64 61 74 61 | 20 69 6e 70 75 74 73 2c |2^n data| inputs,|
|00001de0| 20 6f 6e 65 20 6f 75 74 | 70 75 74 2c 20 61 6e 64 | one out|put, and|
|00001df0| 20 6e 20 63 6f 6e 74 72 | 6f 6c 20 6c 69 6e 65 73 | n contr|ol lines|
|00001e00| 2e 20 49 6e 20 74 68 69 | 73 20 65 78 61 6d 70 6c |. In thi|s exampl|
|00001e10| 65 2c 20 6e 20 3d 20 32 | 20 28 74 77 6f 20 63 6f |e, n = 2| (two co|
|00001e20| 6e 74 72 6f 6c 20 6c 69 | 6e 65 73 3a 20 53 31 2c |ntrol li|nes: S1,|
|00001e30| 20 53 30 29 2e 20 20 54 | 68 65 6e 3a 0d 0d 20 20 | S0). T|hen:.. |
|00001e40| 20 20 20 23 20 6f 66 20 | 63 6f 6e 74 72 6f 6c 20 | # of |control |
|00001e50| 6c 69 6e 65 73 20 3d 20 | 6e 20 3d 20 32 0d 20 20 |lines = |n = 2. |
|00001e60| 20 20 20 23 20 6f 66 20 | 64 61 74 61 20 69 6e 70 | # of |data inp|
|00001e70| 75 74 73 20 20 3d 20 32 | 5e 6e 20 3d 20 32 5e 32 |uts = 2|^n = 2^2|
|00001e80| 20 3d 20 34 0d 20 20 20 | 20 20 23 20 6f 66 20 6f | = 4. | # of o|
|00001e90| 75 74 70 75 74 73 20 3d | 20 31 20 0d 0d 09 09 20 |utputs =| 1 .... |
|00001ea0| 54 68 65 20 64 61 74 61 | 20 6f 6e 20 74 68 65 20 |The data| on the |
|00001eb0| 66 6f 75 72 20 64 61 74 | 61 20 69 6e 70 75 74 20 |four dat|a input |
|00001ec0| 6c 69 6e 65 73 2c 20 44 | 30 2d 44 33 2c 20 61 72 |lines, D|0-D3, ar|
|00001ed0| 65 20 61 72 62 69 74 72 | 61 72 79 20 76 61 6c 75 |e arbitr|ary valu|
|00001ee0| 65 73 2e 20 41 73 73 75 | 6d 65 20 74 68 65 73 65 |es. Assu|me these|
|00001ef0| 20 22 31 27 73 22 20 61 | 6e 64 20 22 30 27 73 22 | "1's" a|nd "0's"|
|00001f00| 20 61 72 65 20 64 61 74 | 61 20 63 6f 6d 69 6e 67 | are dat|a coming|
|00001f10| 20 66 72 6f 6d 20 73 6f | 6d 65 20 6f 74 68 65 72 | from so|me other|
|00001f20| 20 70 61 72 74 20 6f 66 | 20 61 20 6c 61 72 67 65 | part of| a large|
|00001f30| 72 20 63 69 72 63 75 69 | 74 2e 0d 09 09 20 54 68 |r circui|t.... Th|
|00001f40| 65 20 45 64 69 74 20 42 | 6f 78 65 73 20 61 6c 6c |e Edit B|oxes all|
|00001f50| 6f 77 20 79 6f 75 20 74 | 6f 20 61 6c 74 65 72 20 |ow you t|o alter |
|00001f60| 74 68 65 20 76 61 6c 75 | 65 73 20 6f 66 20 74 68 |the valu|es of th|
|00001f70| 65 20 63 6f 6e 74 72 6f | 6c 20 6c 69 6e 65 73 2e |e contro|l lines.|
|00001f80| 20 45 6e 74 65 72 20 61 | 20 22 31 22 20 6f 72 20 | Enter a| "1" or |
|00001f90| 61 20 22 30 22 20 69 6e | 20 65 61 63 68 20 6f 66 |a "0" in| each of|
|00001fa0| 20 74 68 65 20 45 64 69 | 74 20 42 6f 78 65 73 2c | the Edi|t Boxes,|
|00001fb0| 20 74 68 65 6e 20 72 75 | 6e 20 74 68 65 20 73 69 | then ru|n the si|
|00001fc0| 6d 75 6c 61 74 69 6f 6e | 20 74 6f 20 73 65 65 20 |mulation| to see |
|00001fd0| 74 68 65 20 4d 55 58 20 | 6f 75 74 70 75 74 2e 0d |the MUX |output..|
|00001fe0| 20 0d 63 6f 6e 74 72 6f | 6c 20 6c 69 6e 65 73 20 | .contro|l lines |
|00001ff0| 20 20 20 6f 75 74 70 75 | 74 0d 20 20 53 31 20 20 | outpu|t. S1 |
|00002000| 20 53 30 20 20 20 20 20 | 20 20 20 20 20 46 0d 0d | S0 | F..|
|00002010| 20 20 20 30 20 20 20 20 | 30 20 20 20 20 20 20 20 | 0 |0 |
|00002020| 20 20 44 4f 0d 20 20 20 | 30 20 20 20 20 31 20 20 | DO. |0 1 |
|00002030| 20 20 20 20 20 20 20 44 | 31 0d 20 20 20 31 20 20 | D|1. 1 |
|00002040| 20 20 30 20 20 20 20 20 | 20 20 20 20 44 32 0d 20 | 0 | D2. |
|00002050| 20 20 31 20 20 20 20 31 | 20 20 20 20 20 20 20 20 | 1 1| |
|00002060| 20 44 33 0d 0d 0d 4c 65 | 73 73 6f 6e 20 38 20 0d | D3...Le|sson 8 .|
|00002070| 38 2d 42 69 74 20 41 72 | 69 74 68 6d 65 74 69 63 |8-Bit Ar|ithmetic|
|00002080| 20 4c 6f 67 69 63 20 55 | 6e 69 74 0d 0d 09 09 20 | Logic U|nit.... |
|00002090| 54 68 65 20 31 2d 62 69 | 74 20 41 4c 55 20 6f 66 |The 1-bi|t ALU of|
|000020a0| 20 4c 65 73 73 6f 6e 20 | 37 20 69 73 20 61 76 61 | Lesson |7 is ava|
|000020b0| 69 6c 61 62 6c 65 20 61 | 73 20 61 20 63 68 69 70 |ilable a|s a chip|
|000020c0| 20 6b 6e 6f 77 6e 20 61 | 73 20 61 20 22 62 69 74 | known a|s a "bit|
|000020d0| 20 73 6c 69 63 65 22 2e | 20 42 69 74 20 73 6c 69 | slice".| Bit sli|
|000020e0| 63 65 73 20 61 6c 6c 6f | 77 20 61 6e 20 41 4c 55 |ces allo|w an ALU|
|000020f0| 20 74 6f 20 62 65 20 62 | 75 69 6c 74 20 74 6f 20 | to be b|uilt to |
|00002100| 61 6e 79 20 64 65 73 69 | 72 65 64 20 22 77 69 64 |any desi|red "wid|
|00002110| 74 68 22 20 28 77 6f 72 | 64 20 73 69 7a 65 2c 20 |th" (wor|d size, |
|00002120| 6e 75 6d 62 65 72 20 6f | 66 20 62 69 74 73 29 2e |number o|f bits).|
|00002130| 20 42 79 20 6a 6f 69 6e | 69 6e 67 20 65 69 67 68 | By join|ing eigh|
|00002140| 74 20 31 2d 62 69 74 20 | 73 6c 69 63 65 73 20 74 |t 1-bit |slices t|
|00002150| 6f 67 65 74 68 65 72 2c | 20 61 6e 20 38 2d 62 69 |ogether,| an 8-bi|
|00002160| 74 20 41 4c 55 20 69 73 | 20 66 6f 72 6d 65 64 2e |t ALU is| formed.|
|00002170| 20 54 6f 20 6a 6f 69 6e | 20 74 77 6f 20 31 2d 62 | To join| two 1-b|
|00002180| 69 74 20 41 4c 55 73 2c | 20 74 68 65 20 43 61 72 |it ALUs,| the Car|
|00002190| 72 79 20 4f 75 74 20 28 | 43 4f 29 20 6f 66 20 6f |ry Out (|CO) of o|
|000021a0| 6e 65 20 69 73 20 75 73 | 65 64 20 61 73 20 74 68 |ne is us|ed as th|
|000021b0| 65 20 43 61 72 72 79 20 | 49 6e 20 28 43 49 29 20 |e Carry |In (CI) |
|000021c0| 6f 66 20 74 68 65 20 6e | 65 78 74 2e 20 41 6e 20 |of the n|ext. An |
|000021d0| 38 2d 62 69 74 20 41 4c | 55 20 69 73 20 6d 6f 72 |8-bit AL|U is mor|
|000021e0| 65 20 70 72 61 63 74 69 | 63 61 6c 20 74 68 61 6e |e practi|cal than|
|000021f0| 20 74 68 65 20 31 2d 62 | 69 74 20 41 4c 55 20 62 | the 1-b|it ALU b|
|00002200| 65 63 61 75 73 65 20 69 | 74 20 63 61 6e 20 70 65 |ecause i|t can pe|
|00002210| 72 66 6f 72 6d 20 6c 6f | 67 69 63 20 61 6e 64 20 |rform lo|gic and |
|00002220| 61 64 64 69 74 69 6f 6e | 20 6f 70 65 72 61 74 69 |addition| operati|
|00002230| 6f 6e 73 20 6f 6e 20 74 | 77 6f 20 38 2d 62 69 74 |ons on t|wo 8-bit|
|00002240| 20 77 6f 72 64 73 20 28 | 6f 6e 20 74 77 6f 20 62 | words (|on two b|
|00002250| 79 74 65 73 29 2e 20 0d | 09 09 20 54 68 65 20 38 |ytes). .|.. The 8|
|00002260| 2d 62 69 74 20 41 4c 55 | 20 68 61 73 20 74 77 6f |-bit ALU| has two|
|00002270| 20 66 65 61 74 75 72 65 | 73 20 6e 6f 74 20 66 6f | feature|s not fo|
|00002280| 75 6e 64 20 6f 6e 20 74 | 68 65 20 31 2d 62 69 74 |und on t|he 1-bit|
|00002290| 20 41 4c 55 3a 20 61 20 | 7a 65 72 6f 20 66 6c 61 | ALU: a |zero fla|
|000022a0| 67 20 28 5a 20 66 6c 61 | 67 29 20 61 6e 64 20 61 |g (Z fla|g) and a|
|000022b0| 20 6e 65 67 61 74 69 76 | 65 20 66 6c 61 67 20 28 | negativ|e flag (|
|000022c0| 4e 20 66 6c 61 67 29 2e | 20 46 6c 61 67 73 20 61 |N flag).| Flags a|
|000022d0| 72 65 20 63 6f 6e 74 72 | 6f 6c 20 6f 75 74 70 75 |re contr|ol outpu|
|000022e0| 74 73 2e 20 54 68 65 79 | 20 69 6e 64 69 63 61 74 |ts. They| indicat|
|000022f0| 65 20 77 68 65 74 68 65 | 72 20 6f 72 20 6e 6f 74 |e whethe|r or not|
|00002300| 20 61 20 70 61 72 74 69 | 63 75 6c 61 72 20 63 6f | a parti|cular co|
|00002310| 6e 64 69 74 69 6f 6e 20 | 68 61 73 20 62 65 65 6e |ndition |has been|
|00002320| 20 6d 65 74 2e 20 54 68 | 69 73 20 69 6e 66 6f 72 | met. Th|is infor|
|00002330| 6d 61 74 69 6f 6e 20 6d | 61 79 20 62 65 20 70 61 |mation m|ay be pa|
|00002340| 73 73 65 64 20 61 6c 6f | 6e 67 20 74 68 65 20 6f |ssed alo|ng the o|
|00002350| 75 74 70 75 74 20 74 6f | 20 63 6f 6e 74 72 6f 6c |utput to| control|
|00002360| 20 73 6f 6d 65 20 6f 74 | 68 65 72 20 63 6f 6d 70 | some ot|her comp|
|00002370| 6f 6e 65 6e 74 20 69 6e | 20 61 20 6c 61 72 67 65 |onent in| a large|
|00002380| 72 20 63 69 72 63 75 69 | 74 2e 0d 09 09 20 49 66 |r circui|t.... If|
|00002390| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 74 | the res|ult of t|
|000023a0| 68 65 20 41 4c 55 20 6f | 70 65 72 61 74 69 6f 6e |he ALU o|peration|
|000023b0| 20 69 73 20 7a 65 72 6f | 2c 20 74 68 65 20 5a 20 | is zero|, the Z |
|000023c0| 66 6c 61 67 20 69 73 20 | 22 73 65 74 22 20 28 67 |flag is |"set" (g|
|000023d0| 69 76 65 6e 20 61 20 76 | 61 6c 75 65 20 6f 66 20 |iven a v|alue of |
|000023e0| 22 31 22 2c 20 22 6f 6e | 22 29 2e 20 49 66 20 74 |"1", "on|"). If t|
|000023f0| 68 65 20 72 65 73 75 6c | 74 20 6f 66 20 74 68 65 |he resul|t of the|
|00002400| 20 41 4c 55 20 6f 70 65 | 72 61 74 69 6f 6e 20 69 | ALU ope|ration i|
|00002410| 73 20 61 20 6e 65 67 61 | 74 69 76 65 20 76 61 6c |s a nega|tive val|
|00002420| 75 65 2c 20 74 68 65 20 | 4e 20 66 6c 61 67 20 69 |ue, the |N flag i|
|00002430| 73 20 22 73 65 74 22 20 | 28 73 65 74 20 74 6f 20 |s "set" |(set to |
|00002440| 22 31 22 2c 20 22 6f 6e | 22 29 2e 20 54 77 6f 20 |"1", "on|"). Two |
|00002450| 6f 74 68 65 72 20 63 6f | 6e 74 72 6f 6c 20 6f 75 |other co|ntrol ou|
|00002460| 74 70 75 74 73 20 74 68 | 61 74 20 61 6e 20 41 4c |tputs th|at an AL|
|00002470| 55 20 6d 61 79 20 68 61 | 76 65 20 61 72 65 20 66 |U may ha|ve are f|
|00002480| 6c 61 67 73 20 74 6f 20 | 69 6e 64 69 63 61 74 65 |lags to |indicate|
|00002490| 20 74 68 61 74 20 61 6e | 20 6f 76 65 72 66 6c 6f | that an| overflo|
|000024a0| 77 20 6f 72 20 61 20 63 | 61 72 72 79 20 6f 75 74 |w or a c|arry out|
|000024b0| 20 6f 66 20 74 68 65 20 | 68 69 67 68 65 73 74 20 | of the |highest |
|000024c0| 62 69 74 20 68 61 73 20 | 6f 63 63 75 72 72 65 64 |bit has |occurred|
|000024d0| 2e 20 0d 0d 0d 7b 20 2a | 2a 2a 2a 2a 2a 2a 2a 2a |. ...{ *|********|
|000024e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000024f0| 2a 2a 20 7d 0d 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |** }.The| followi|
|00002500| 6e 67 20 73 65 63 74 69 | 6f 6e 20 64 65 73 63 72 |ng secti|on descr|
|00002510| 69 62 65 73 20 74 68 65 | 20 41 4c 55 27 73 20 72 |ibes the| ALU's r|
|00002520| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 20 6f 66 |epresent|ation of|
|00002530| 20 6e 65 67 61 74 69 76 | 65 20 6e 75 6d 62 65 72 | negativ|e number|
|00002540| 73 2e 20 49 66 20 79 6f | 75 20 73 65 74 20 53 31 |s. If yo|u set S1|
|00002550| 3d 31 2c 53 30 3d 31 20 | 66 6f 72 20 61 64 64 69 |=1,S0=1 |for addi|
|00002560| 74 69 6f 6e 2c 20 61 6e | 64 20 79 6f 75 20 64 6f |tion, an|d you do|
|00002570| 20 6e 6f 74 20 75 6e 64 | 65 72 73 74 61 6e 64 20 | not und|erstand |
|00002580| 68 6f 77 20 74 68 65 20 | 73 75 6d 20 6f 66 20 74 |how the |sum of t|
|00002590| 68 65 20 41 20 61 6e 64 | 20 42 20 77 6f 72 64 73 |he A and| B words|
|000025a0| 20 77 61 73 20 64 65 74 | 65 72 6d 69 6e 65 64 2c | was det|ermined,|
|000025b0| 20 72 65 61 64 20 74 68 | 69 73 20 73 65 63 74 69 | read th|is secti|
|000025c0| 6f 6e 2e 20 20 0d 7b 20 | 2a 2a 2a 2a 2a 2a 2a 2a |on. .{ |********|
|000025d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000025e0| 2a 2a 2a 20 7d 0d 0d a5 | 20 54 48 45 20 41 4c 55 |*** }...| THE ALU|
|000025f0| 73 20 45 58 50 52 45 53 | 53 49 4f 4e 20 4f 46 20 |s EXPRES|SION OF |
|00002600| 4e 55 4d 42 45 52 53 20 | 49 4e 20 32 27 73 20 43 |NUMBERS |IN 2's C|
|00002610| 4f 4d 50 4c 45 4d 45 4e | 54 20 46 4f 52 4d 20 0d |OMPLEMEN|T FORM .|
|00002620| 0d 09 09 20 54 68 65 20 | 38 2d 62 69 74 20 41 4c |... The |8-bit AL|
|00002630| 55 20 6f 66 20 74 68 69 | 73 20 65 78 61 6d 70 6c |U of thi|s exampl|
|00002640| 65 20 75 73 65 73 20 22 | 32 27 73 20 63 6f 6d 70 |e uses "|2's comp|
|00002650| 6c 65 6d 65 6e 74 20 66 | 6f 72 6d 22 20 74 6f 20 |lement f|orm" to |
|00002660| 65 78 70 72 65 73 73 20 | 6e 65 67 61 74 69 76 65 |express |negative|
|00002670| 20 6e 75 6d 62 65 72 73 | 2e 20 54 6f 20 65 78 70 | numbers|. To exp|
|00002680| 72 65 73 73 20 61 20 62 | 69 6e 61 72 79 20 6e 65 |ress a b|inary ne|
|00002690| 67 61 74 69 76 65 20 6e | 75 6d 62 65 72 20 69 6e |gative n|umber in|
|000026a0| 20 32 27 73 20 63 6f 6d | 70 6c 65 6d 65 6e 74 2c | 2's com|plement,|
|000026b0| 20 66 6f 6c 6c 6f 77 20 | 74 68 65 73 65 20 73 74 | follow |these st|
|000026c0| 65 70 73 3a 0d 0d 09 31 | 29 20 20 73 74 61 72 74 |eps:...1|) start|
|000026d0| 20 77 69 74 68 20 74 68 | 65 20 62 69 6e 61 72 79 | with th|e binary|
|000026e0| 20 76 61 6c 75 65 20 6f | 66 20 74 68 65 20 61 62 | value o|f the ab|
|000026f0| 73 6f 6c 75 74 65 20 76 | 61 6c 75 65 20 6f 66 20 |solute v|alue of |
|00002700| 74 68 65 20 62 61 73 65 | 31 30 20 6e 75 6d 62 65 |the base|10 numbe|
|00002710| 72 0d 09 32 29 20 20 72 | 65 76 65 72 73 65 20 65 |r..2) r|everse e|
|00002720| 61 63 68 20 64 69 67 69 | 74 20 6f 66 20 74 68 65 |ach digi|t of the|
|00002730| 20 70 6f 73 69 74 69 76 | 65 20 6e 75 6d 62 65 72 | positiv|e number|
|00002740| 20 0d 09 09 20 20 20 20 | 28 61 6c 6c 20 22 31 27 | ... |(all "1'|
|00002750| 73 22 20 62 65 63 6f 6d | 65 20 22 30 27 73 22 2c |s" becom|e "0's",|
|00002760| 20 61 6c 6c 20 22 30 27 | 73 22 20 62 65 63 6f 6d | all "0'|s" becom|
|00002770| 65 20 22 31 27 73 22 29 | 0d 09 33 29 20 20 61 64 |e "1's")|..3) ad|
|00002780| 64 20 22 31 22 20 74 6f | 20 74 68 65 20 72 65 73 |d "1" to| the res|
|00002790| 75 6c 74 0d 0d 0d 45 58 | 41 4d 50 4c 45 20 31 2c |ult...EX|AMPLE 1,|
|000027a0| 20 32 27 73 20 63 6f 6d | 70 6c 65 6d 65 6e 74 3a | 2's com|plement:|
|000027b0| 0d 09 09 20 45 78 70 72 | 65 73 73 20 64 65 63 69 |... Expr|ess deci|
|000027c0| 6d 61 6c 20 22 2d 35 22 | 20 69 6e 20 32 27 73 20 |mal "-5"| in 2's |
|000027d0| 63 6f 6d 70 6c 65 6d 65 | 6e 74 20 66 6f 72 6d 20 |compleme|nt form |
|000027e0| 75 73 69 6e 67 20 74 68 | 65 20 61 62 6f 76 65 20 |using th|e above |
|000027f0| 73 74 65 70 73 2e 0d 0d | 09 31 29 20 20 20 61 62 |steps...|.1) ab|
|00002800| 73 6f 6c 75 74 65 20 76 | 61 6c 75 65 20 6f 66 20 |solute v|alue of |
|00002810| 2d 35 20 20 3d 20 20 35 | 0d 09 0d 09 09 20 20 20 |-5 = 5|..... |
|00002820| 35 20 62 61 73 65 31 30 | 20 20 3d 20 20 30 30 30 |5 base10| = 000|
|00002830| 30 30 31 30 31 20 62 61 | 73 65 32 0d 0d 09 32 29 |00101 ba|se2...2)|
|00002840| 20 20 20 72 65 76 65 72 | 73 65 20 64 69 67 69 74 | rever|se digit|
|00002850| 73 3a 20 20 20 30 30 30 | 30 30 31 30 31 20 20 2d |s: 000|00101 -|
|00002860| 2d 3e 3e 20 20 31 31 31 | 31 31 30 31 30 0d 0d 09 |->> 111|11010...|
|00002870| 33 29 20 20 20 61 64 64 | 20 22 31 22 20 20 20 20 |3) add| "1" |
|00002880| 31 31 31 31 31 30 31 30 | 0d 20 20 20 20 20 20 20 |11111010|. |
|00002890| 20 20 20 20 20 20 20 20 | 20 2b 20 20 20 20 20 20 | | + |
|000028a0| 20 31 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | 1. | |
|000028b0| 20 20 20 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 0d 20 20 | _____|_____. |
|000028c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 31 | | 1|
|000028d0| 31 31 31 31 30 31 31 0d | 0d 20 09 72 65 73 75 6c |1111011.|. .resul|
|000028e0| 74 3a 20 20 20 2d 35 20 | 62 61 73 65 31 30 20 20 |t: -5 |base10 |
|000028f0| 3d 20 20 31 31 31 31 31 | 30 31 31 20 62 61 73 65 |= 11111|011 base|
|00002900| 32 2c 20 32 27 73 20 63 | 6f 6d 70 6c 65 6d 65 6e |2, 2's c|omplemen|
|00002910| 74 0d 0d 0d 09 09 20 4e | 6f 74 65 20 74 68 61 74 |t..... N|ote that|
|00002920| 20 74 68 65 20 48 69 67 | 68 20 4f 72 64 65 72 20 | the Hig|h Order |
|00002930| 62 69 74 20 28 48 4f 2c | 6c 65 66 74 6d 6f 73 74 |bit (HO,|leftmost|
|00002940| 20 62 69 74 29 20 6f 66 | 20 74 68 65 20 72 65 73 | bit) of| the res|
|00002950| 75 6c 74 20 28 31 31 31 | 31 31 30 31 31 29 20 69 |ult (111|11011) i|
|00002960| 73 20 61 20 22 31 22 2e | 20 54 68 69 73 20 77 69 |s a "1".| This wi|
|00002970| 6c 6c 20 41 4c 57 41 59 | 53 20 62 65 20 74 68 65 |ll ALWAY|S be the|
|00002980| 20 63 61 73 65 2e 20 54 | 68 69 73 20 66 61 63 74 | case. T|his fact|
|00002990| 20 69 73 20 6d 61 64 65 | 20 75 73 65 20 6f 66 20 | is made| use of |
|000029a0| 62 79 20 74 68 65 20 41 | 4c 55 27 73 20 4e 20 66 |by the A|LU's N f|
|000029b0| 6c 61 67 2e 20 54 68 65 | 20 41 4c 55 20 73 69 6d |lag. The| ALU sim|
|000029c0| 70 6c 79 20 22 74 61 70 | 73 22 20 74 68 65 20 48 |ply "tap|s" the H|
|000029d0| 69 67 68 20 4f 72 64 65 | 72 20 62 69 74 20 6f 66 |igh Orde|r bit of|
|000029e0| 20 74 68 65 20 72 65 73 | 75 6c 74 20 28 46 37 29 | the res|ult (F7)|
|000029f0| 20 61 6e 64 20 73 65 6e | 64 73 20 69 74 20 6f 75 | and sen|ds it ou|
|00002a00| 74 20 61 73 20 74 68 65 | 20 4e 20 66 6c 61 67 2e |t as the| N flag.|
|00002a10| 20 41 6e 20 4e 20 66 6c | 61 67 20 76 61 6c 75 65 | An N fl|ag value|
|00002a20| 20 6f 66 20 22 31 22 20 | 6d 65 61 6e 73 20 74 68 | of "1" |means th|
|00002a30| 65 20 41 4c 55 20 72 65 | 73 75 6c 74 20 69 73 20 |e ALU re|sult is |
|00002a40| 6e 65 67 61 74 69 76 65 | 2e 0d 0d 0d 45 58 41 4d |negative|....EXAM|
|00002a50| 50 4c 45 20 32 2c 20 61 | 64 64 69 74 69 6f 6e 20 |PLE 2, a|ddition |
|00002a60| 69 6e 76 6f 6c 76 69 6e | 67 20 61 20 6e 65 67 61 |involvin|g a nega|
|00002a70| 74 69 76 65 20 6e 75 6d | 62 65 72 3a 0d 09 09 20 |tive num|ber:... |
|00002a80| 45 78 70 72 65 73 73 20 | 74 68 65 20 73 75 6d 20 |Express |the sum |
|00002a90| 6f 66 20 64 65 63 69 6d | 61 6c 20 22 2d 35 22 20 |of decim|al "-5" |
|00002aa0| 61 64 64 65 64 20 74 6f | 20 64 65 63 69 6d 61 6c |added to| decimal|
|00002ab0| 20 22 2b 33 22 20 61 73 | 20 61 20 62 69 6e 61 72 | "+3" as| a binar|
|00002ac0| 79 20 6e 75 6d 62 65 72 | 2e 0d 0d 20 20 a5 20 20 |y number|... . |
|00002ad0| 20 66 72 6f 6d 20 45 78 | 61 6d 70 6c 65 20 31 2c | from Ex|ample 1,|
|00002ae0| 20 2d 35 20 62 61 73 65 | 31 30 20 20 3d 20 20 31 | -5 base|10 = 1|
|00002af0| 31 31 31 31 30 31 31 20 | 62 61 73 65 32 2c 20 32 |1111011 |base2, 2|
|00002b00| 27 73 20 63 6f 6d 70 6c | 65 6d 65 6e 74 0d 0d 20 |'s compl|ement.. |
|00002b10| 20 a5 20 20 20 2b 33 20 | 62 61 73 65 31 30 20 20 | . +3 |base10 |
|00002b20| 3d 20 20 30 30 30 30 30 | 30 31 31 20 62 61 73 65 |= 00000|011 base|
|00002b30| 32 0d 0d 20 20 a5 20 20 | 20 2d 35 20 2b 20 28 2b |2.. . | -5 + (+|
|00002b40| 33 29 3a 20 20 20 20 20 | 20 31 31 31 31 31 30 31 |3): | 1111101|
|00002b50| 31 20 20 20 20 28 2d 35 | 29 0d 20 20 20 20 20 20 |1 (-5|). |
|00002b60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2b 20 | | + |
|00002b70| 30 30 30 30 30 30 31 31 | 20 20 20 20 28 2b 33 29 |00000011| (+3)|
|00002b80| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002b90| 20 20 20 20 20 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0d | ___|_______.|
|00002ba0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002bb0| 20 20 20 20 20 20 31 31 | 31 31 31 31 31 30 20 20 | 11|111110 |
|00002bc0| 20 20 28 2d 32 29 0d 0d | 20 20 72 65 73 75 6c 74 | (-2)..| result|
|00002bd0| 3a 20 20 20 2d 35 20 2b | 20 28 2b 33 29 20 3d 20 |: -5 +| (+3) = |
|00002be0| 20 31 31 31 31 31 31 31 | 30 20 20 2c 20 32 27 73 | 1111111|0 , 2's|
|00002bf0| 20 63 6f 6d 70 6c 65 6d | 65 6e 74 0d 0d 4e 6f 74 | complem|ent..Not|
|00002c00| 65 20 74 68 61 74 20 74 | 68 65 20 48 69 67 68 20 |e that t|he High |
|00002c10| 4f 72 64 65 72 20 62 69 | 74 20 69 73 20 61 20 22 |Order bi|t is a "|
|00002c20| 31 22 2c 20 73 69 67 6e | 69 66 79 69 6e 67 20 61 |1", sign|ifying a|
|00002c30| 20 6e 65 67 61 74 69 76 | 65 20 6e 75 6d 62 65 72 | negativ|e number|
|00002c40| 2e 0d 0d 54 6f 20 66 69 | 6e 64 20 74 68 65 20 61 |...To fi|nd the a|
|00002c50| 62 73 6f 6c 75 74 65 20 | 76 61 6c 75 65 20 6f 66 |bsolute |value of|
|00002c60| 20 61 20 32 27 73 20 63 | 6f 6d 70 6c 65 6d 65 6e | a 2's c|omplemen|
|00002c70| 74 20 6e 75 6d 62 65 72 | 20 69 6e 20 64 65 63 69 |t number| in deci|
|00002c80| 6d 61 6c 20 66 6f 72 6d | 2c 20 66 6f 6c 6c 6f 77 |mal form|, follow|
|00002c90| 20 74 68 65 73 65 20 73 | 74 65 70 73 3a 0d 0d 09 | these s|teps:...|
|00002ca0| 31 29 20 20 72 65 76 65 | 72 73 65 20 65 61 63 68 |1) reve|rse each|
|00002cb0| 20 64 69 67 69 74 20 6f | 66 20 74 68 65 20 32 27 | digit o|f the 2'|
|00002cc0| 73 20 63 6f 6d 70 6c 65 | 6d 65 6e 74 20 6e 75 6d |s comple|ment num|
|00002cd0| 62 65 72 20 0d 09 32 29 | 20 20 61 64 64 20 22 31 |ber ..2)| add "1|
|00002ce0| 22 20 74 6f 20 74 68 65 | 20 72 65 73 75 6c 74 0d |" to the| result.|
|00002cf0| 0d 54 6f 20 76 65 72 69 | 66 79 20 74 68 65 20 72 |.To veri|fy the r|
|00002d00| 65 73 75 6c 74 20 6f 66 | 20 45 78 61 6d 70 6c 65 |esult of| Example|
|00002d10| 20 32 2c 20 75 73 65 20 | 74 68 65 20 61 62 6f 76 | 2, use |the abov|
|00002d20| 65 20 73 74 65 70 73 3a | 0d 0d 20 20 66 72 6f 6d |e steps:|.. from|
|00002d30| 20 72 65 73 75 6c 74 20 | 6f 66 20 45 78 61 6d 70 | result |of Examp|
|00002d40| 6c 65 20 32 3a 20 2d 32 | 20 62 61 73 65 31 30 20 |le 2: -2| base10 |
|00002d50| 20 20 3d 20 20 31 31 31 | 31 31 31 31 30 20 20 20 | = 111|11110 |
|00002d60| 2c 20 32 27 73 20 63 6f | 6d 70 6c 65 6d 65 6e 74 |, 2's co|mplement|
|00002d70| 0d 0d 20 20 31 29 20 20 | 20 72 65 76 65 72 73 65 |.. 1) | reverse|
|00002d80| 20 64 69 67 69 74 73 3a | 20 20 20 31 31 31 31 31 | digits:| 11111|
|00002d90| 31 31 30 20 20 2d 2d 3e | 3e 20 20 30 30 30 30 30 |110 -->|> 00000|
|00002da0| 30 30 31 0d 0d 20 20 32 | 29 20 20 20 61 64 64 20 |001.. 2|) add |
|00002db0| 22 31 22 20 20 20 20 30 | 30 30 30 30 30 30 31 0d |"1" 0|0000001.|
|00002dc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002dd0| 2b 20 20 20 20 20 20 20 | 20 31 0d 20 20 20 20 20 |+ | 1. |
|00002de0| 20 20 20 20 20 20 20 20 | 20 20 20 5f 5f 5f 5f 5f | | _____|
|00002df0| 5f 5f 5f 5f 5f 0d 20 20 | 20 20 20 20 20 20 20 20 |_____. | |
|00002e00| 20 20 20 20 20 20 20 20 | 30 30 30 30 30 30 31 30 | |00000010|
|00002e10| 0d 0d 0d 20 09 72 65 73 | 75 6c 74 3a 20 20 20 61 |... .res|ult: a|
|00002e20| 62 73 6f 6c 75 74 65 20 | 76 61 6c 75 65 20 6f 66 |bsolute |value of|
|00002e30| 20 2d 35 20 2b 20 28 2b | 33 29 20 3d 20 32 0d 0d | -5 + (+|3) = 2..|
|00002e40| 0d 54 48 45 20 47 52 41 | 50 48 49 43 20 57 49 4e |.THE GRA|PHIC WIN|
|00002e50| 44 4f 57 0d 0d 09 09 20 | 54 68 65 20 47 72 61 70 |DOW.... |The Grap|
|00002e60| 68 69 63 20 57 69 6e 64 | 6f 77 20 73 68 6f 77 73 |hic Wind|ow shows|
|00002e70| 20 61 6e 20 38 2d 62 69 | 74 20 61 72 69 74 68 6d | an 8-bi|t arithm|
|00002e80| 65 74 69 63 20 6c 6f 67 | 69 63 20 75 6e 69 74 20 |etic log|ic unit |
|00002e90| 28 38 2d 62 69 74 20 41 | 4c 55 29 2e 20 54 68 65 |(8-bit A|LU). The|
|00002ea0| 20 45 64 69 74 20 42 6f | 78 65 73 20 61 6c 6c 6f | Edit Bo|xes allo|
|00002eb0| 77 20 79 6f 75 20 74 6f | 20 65 6e 74 65 72 20 74 |w you to| enter t|
|00002ec0| 77 6f 20 38 2d 62 69 74 | 20 77 6f 72 64 73 20 28 |wo 8-bit| words (|
|00002ed0| 41 20 61 6e 64 20 42 29 | 20 74 68 61 74 20 77 69 |A and B)| that wi|
|00002ee0| 6c 6c 20 68 61 76 65 20 | 73 6f 6d 65 20 6c 6f 67 |ll have |some log|
|00002ef0| 69 63 20 6f 70 65 72 61 | 74 69 6f 6e 20 6f 72 20 |ic opera|tion or |
|00002f00| 61 64 64 69 74 69 6f 6e | 20 70 65 72 66 6f 72 6d |addition| perform|
|00002f10| 65 64 20 6f 6e 20 74 68 | 65 6d 2e 20 59 6f 75 20 |ed on th|em. You |
|00002f20| 6d 61 79 20 61 6c 73 6f | 20 65 6e 74 65 72 20 74 |may also| enter t|
|00002f30| 68 65 20 63 6f 6e 74 72 | 6f 6c 20 28 73 65 6c 65 |he contr|ol (sele|
|00002f40| 63 74 29 20 6c 69 6e 65 | 20 76 61 6c 75 65 73 20 |ct) line| values |
|00002f50| 28 53 31 2c 53 30 29 20 | 74 68 61 74 20 64 65 74 |(S1,S0) |that det|
|00002f60| 65 72 6d 69 6e 65 20 77 | 68 69 63 68 20 6f 70 65 |ermine w|hich ope|
|00002f70| 72 61 74 69 6f 6e 20 77 | 69 6c 6c 20 62 65 20 70 |ration w|ill be p|
|00002f80| 65 72 66 6f 72 6d 65 64 | 2e 20 54 68 65 20 41 4c |erformed|. The AL|
|00002f90| 55 20 69 73 20 63 61 70 | 61 62 6c 65 20 6f 66 20 |U is cap|able of |
|00002fa0| 70 65 72 66 6f 72 6d 69 | 6e 67 20 6f 6e 65 20 6f |performi|ng one o|
|00002fb0| 66 20 66 6f 75 72 20 6f | 70 65 72 61 74 69 6f 6e |f four o|peration|
|00002fc0| 73 20 28 74 68 65 20 73 | 61 6d 65 20 66 6f 75 72 |s (the s|ame four|
|00002fd0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 61 73 20 74 | operati|ons as t|
|00002fe0| 68 65 20 31 2d 62 69 74 | 20 41 4c 55 2c 20 4c 65 |he 1-bit| ALU, Le|
|00002ff0| 73 73 6f 6e 20 37 29 3a | 20 0d 0d 20 20 20 a5 20 |sson 7):| .. . |
|00003000| 6c 6f 67 69 63 20 41 4e | 44 20 6f 6e 20 41 2c 42 |logic AN|D on A,B|
|00003010| 0d 20 20 20 a5 20 6c 6f | 67 69 63 20 4f 52 20 6f |. . lo|gic OR o|
|00003020| 6e 20 41 2c 42 0d 20 20 | 20 a5 20 69 6e 76 65 72 |n A,B. | . inver|
|00003030| 74 20 42 0d 20 20 20 a5 | 20 61 64 64 20 41 20 74 |t B. .| add A t|
|00003040| 6f 20 42 0d 0d 45 6e 74 | 65 72 20 61 20 22 31 22 |o B..Ent|er a "1"|
|00003050| 20 6f 72 20 61 20 22 30 | 22 20 69 6e 20 65 61 63 | or a "0|" in eac|
|00003060| 68 20 6f 66 20 74 68 65 | 20 45 64 69 74 20 42 6f |h of the| Edit Bo|
|00003070| 78 65 73 2c 20 74 68 65 | 6e 20 72 75 6e 20 74 68 |xes, the|n run th|
|00003080| 65 20 73 69 6d 75 6c 61 | 74 69 6f 6e 2e 20 54 68 |e simula|tion. Th|
|00003090| 65 20 72 65 73 75 6c 74 | 20 6f 66 20 74 68 65 20 |e result| of the |
|000030a0| 6c 6f 67 69 63 20 6f 70 | 65 72 61 74 69 6f 6e 20 |logic op|eration |
|000030b0| 61 70 70 65 61 72 73 20 | 61 74 20 6f 75 74 70 75 |appears |at outpu|
|000030c0| 74 20 46 2e 0d 0d 20 20 | 63 6f 6e 74 72 6f 6c 20 |t F... |control |
|000030d0| 6c 69 6e 65 73 20 20 20 | 20 6f 75 74 70 75 74 20 |lines | output |
|000030e0| 72 65 73 75 6c 74 0d 20 | 20 20 20 20 53 32 20 20 |result. | S2 |
|000030f0| 20 53 31 20 20 20 20 20 | 20 20 20 28 6f 70 65 72 | S1 | (oper|
|00003100| 61 74 69 6f 6e 29 0d 0d | 20 20 20 20 20 30 20 20 |ation)..| 0 |
|00003110| 20 20 30 20 20 20 20 20 | 20 20 20 20 20 41 20 41 | 0 | A A|
|00003120| 4e 44 20 42 0d 20 20 20 | 20 20 30 20 20 20 20 31 |ND B. | 0 1|
|00003130| 20 20 20 20 20 20 20 20 | 20 20 41 20 4f 52 20 42 | | A OR B|
|00003140| 0d 20 20 20 20 20 31 20 | 20 20 20 30 20 20 20 20 |. 1 | 0 |
|00003150| 20 20 20 20 20 20 42 20 | 4e 4f 54 20 28 69 6e 76 | B |NOT (inv|
|00003160| 65 72 74 20 42 29 0d 20 | 20 20 20 20 31 20 20 20 |ert B). | 1 |
|00003170| 20 31 20 20 20 20 20 20 | 20 20 20 20 41 20 2b 20 | 1 | A + |
|00003180| 42 20 28 41 20 61 64 64 | 65 64 20 74 6f 20 42 29 |B (A add|ed to B)|
|00003190| 0d 20 0d 0d 0d 00 00 00 | 00 00 00 00 00 00 00 00 |. ......|........|
|000031a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003200| 00 00 01 00 00 00 01 5c | 00 00 00 5c 00 00 00 5a |.......\|...\...Z|
|00003210| 00 00 10 08 00 00 10 08 | 00 00 10 07 ff ff e0 04 |........|........|
|00003220| 00 00 20 04 00 00 20 04 | 00 00 20 07 ff ff e0 00 |.. ... .|.. .....|
|00003230| 0d 6c 65 73 73 6f 6e 73 | 31 2e 74 65 78 74 02 00 |.lessons|1.text..|
|00003240| 00 00 54 45 58 54 50 45 | 44 54 01 00 00 c0 00 c0 |..TEXTPE|DT......|
|00003250| 00 00 54 45 58 54 50 45 | 44 54 01 00 00 c0 00 c0 |..TEXTPE|DT......|
|00003260| 6a 19 00 00 00 00 00 00 | 00 00 00 00 76 54 00 00 |j.......|....vT..|
|00003270| 00 00 a0 86 4c 6e 00 00 | 31 15 00 00 01 b6 f0 0f |....Ln..|1.......|
|00003280| ff ff f0 0f ff ff f0 0f | ff ff f0 0f ff ff f0 0f |........|........|
|00003290| ff ff f0 0f ff ff f0 0f | ff ff f0 07 ff ff e0 07 |........|........|
|000032a0| ff ff e0 07 ff ff e0 07 | ff ff e0 07 ff ff e0 00 |........|........|
|000032b0| 00 00 07 5a 53 59 53 00 | 01 00 00 00 00 07 46 4e |...ZSYS.|......FN|
|000032c0| 44 52 00 02 00 00 00 00 | 07 49 4e 49 54 00 03 00 |DR......|.INIT...|
|000032d0| 00 00 00 07 43 4c 49 50 | 00 04 00 00 00 00 07 46 |....CLIP|.......F|
|000032e0| 44 4f 43 00 05 00 00 00 | 00 24 54 4d 4c 50 00 00 |DOC.....|.$TMLP..|
|000032f0| 00 01 49 43 4e 23 00 01 | 00 01 24 8a 00 02 19 a8 |..ICN#..|..$.....|
|00003300| 00 00 00 40 00 09 06 47 | 65 6e 65 76 61 00 24 51 |...@...G|eneva.$Q|
|00003310| 00 00 00 4a 7f ff 00 63 | 00 db 00 dc 01 1e 01 1f |...J...c|........|
|00003320| 7f ff 00 64 00 dc 01 1e | 7f ff 00 00 00 54 00 00 |...d....|.....T..|
|00003330| 58 48 00 4c 00 38 00 da | 00 4a 01 20 00 38 00 dc |XH.L.8..|.J. .8..|
|00003340| 01 1e 7f ff 00 00 00 04 | 00 03 00 01 00 00 00 0c |........|........|
|00003350| 00 00 00 4a 00 00 14 aa | 00 00 15 56 00 00 01 00 |...J....|...V....|
|00003360| 00 00 01 5c 00 00 00 5c | 00 00 00 5a 00 03 30 38 |...\...\|...Z..08|
|00003370| 02 94 00 00 00 1c 00 5a | 00 02 45 46 4e 54 00 00 |.......Z|..EFNT..|
|00003380| 00 1a 45 54 41 42 00 00 | 00 26 45 50 4f 53 00 00 |..ETAB..|.&EPOS..|
|00003390| 00 32 03 eb ff ff 00 00 | 00 00 00 00 00 00 03 ec |.2......|........|
|000033a0| ff ff 00 00 00 44 00 00 | 00 00 03 ed ff ff 00 00 |.....D..|........|
|000033b0| 00 4c 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.L......|........|
|000033c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000033f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+